Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/files_spec.rb')
-rw-r--r--spec/requests/api/files_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/requests/api/files_spec.rb b/spec/requests/api/files_spec.rb
index 8cd2f00a718..71a4a1a2784 100644
--- a/spec/requests/api/files_spec.rb
+++ b/spec/requests/api/files_spec.rb
@@ -517,6 +517,21 @@ RSpec.describe API::Files do
expect(response).to have_gitlab_http_status(:ok)
end
+ context 'when ref is not provided' do
+ before do
+ stub_application_setting(default_branch_name: 'main')
+ end
+
+ it 'returns response :ok', :aggregate_failures do
+ url = route(file_path) + "/raw"
+ expect(Gitlab::Workhorse).to receive(:send_git_blob)
+
+ get api(url, current_user), params: {}
+
+ expect(response).to have_gitlab_http_status(:ok)
+ end
+ end
+
it 'returns raw file info for files with dots' do
url = route('.gitignore') + "/raw"
expect(Gitlab::Workhorse).to receive(:send_git_blob)