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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-20 12:08:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-20 12:08:32 +0300
commit2ee5991b42717969af93cb30d863aafab04dff8a (patch)
treec09c0b7b4d02ceb9d6ac090c1ccfb93effb8a368 /spec/support/shared_examples/controllers
parent6b1ba27ef7373815ea29dc5b80eab846c8acd022 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/controllers')
-rw-r--r--spec/support/shared_examples/controllers/external_authorization_service_shared_examples.rb4
-rw-r--r--spec/support/shared_examples/controllers/paginated_collection_shared_examples.rb2
-rw-r--r--spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb14
-rw-r--r--spec/support/shared_examples/controllers/todos_shared_examples.rb8
-rw-r--r--spec/support/shared_examples/controllers/uploads_actions_shared_examples.rb28
5 files changed, 28 insertions, 28 deletions
diff --git a/spec/support/shared_examples/controllers/external_authorization_service_shared_examples.rb b/spec/support/shared_examples/controllers/external_authorization_service_shared_examples.rb
index d8a1ae83f61..cccce7b91b5 100644
--- a/spec/support/shared_examples/controllers/external_authorization_service_shared_examples.rb
+++ b/spec/support/shared_examples/controllers/external_authorization_service_shared_examples.rb
@@ -16,7 +16,7 @@ shared_examples 'disabled when using an external authorization service' do
subject
- expect(response).to have_gitlab_http_status(403)
+ expect(response).to have_gitlab_http_status(:forbidden)
end
end
@@ -37,6 +37,6 @@ shared_examples 'unauthorized when external service denies access' do
subject
- expect(response).to have_gitlab_http_status(403)
+ expect(response).to have_gitlab_http_status(:forbidden)
end
end
diff --git a/spec/support/shared_examples/controllers/paginated_collection_shared_examples.rb b/spec/support/shared_examples/controllers/paginated_collection_shared_examples.rb
index bd84bd1093f..41a8d2d8117 100644
--- a/spec/support/shared_examples/controllers/paginated_collection_shared_examples.rb
+++ b/spec/support/shared_examples/controllers/paginated_collection_shared_examples.rb
@@ -11,7 +11,7 @@ shared_examples 'paginated collection' do
it 'renders a page number that is not ouf of range' do
get action, params: params.merge(page: last_page)
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
it 'redirects to last_page if page number is larger than number of pages' do
diff --git a/spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb b/spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb
index 5dea17069f9..8e5fae5da18 100644
--- a/spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb
+++ b/spec/support/shared_examples/controllers/repository_lfs_file_load_examples.rb
@@ -51,7 +51,7 @@ shared_examples 'a controller that can serve LFS files' do |options = {}|
subject
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
context 'and lfs uses object storage' do
@@ -65,7 +65,7 @@ shared_examples 'a controller that can serve LFS files' do |options = {}|
it 'responds with redirect to file' do
subject
- expect(response).to have_gitlab_http_status(302)
+ expect(response).to have_gitlab_http_status(:found)
expect(response.location).to include(lfs_object.reload.file.path)
end
@@ -84,7 +84,7 @@ shared_examples 'a controller that can serve LFS files' do |options = {}|
it 'does not serve the file' do
subject
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
end
@@ -97,7 +97,7 @@ shared_examples 'a controller that can serve LFS files' do |options = {}|
it 'does not serve the file if no members are linked to the LfsObject' do
subject
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
it 'serves the file when the fork network root is linked to the LfsObject' do
@@ -105,7 +105,7 @@ shared_examples 'a controller that can serve LFS files' do |options = {}|
subject
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
it 'serves the file when the fork network member is linked to the LfsObject' do
@@ -113,7 +113,7 @@ shared_examples 'a controller that can serve LFS files' do |options = {}|
subject
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
end
@@ -154,7 +154,7 @@ shared_examples 'a controller that can serve LFS files' do |options = {}|
subject
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
expect(response.header['Content-Type']).to eq('text/plain; charset=utf-8')
expect(response.header['Content-Disposition'])
.to eq('inline')
diff --git a/spec/support/shared_examples/controllers/todos_shared_examples.rb b/spec/support/shared_examples/controllers/todos_shared_examples.rb
index 914bf506320..e220f6bfc9b 100644
--- a/spec/support/shared_examples/controllers/todos_shared_examples.rb
+++ b/spec/support/shared_examples/controllers/todos_shared_examples.rb
@@ -12,13 +12,13 @@ shared_examples 'todos actions' do
post_create
end.to change { user.todos.count }.by(1)
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
it 'returns todo path and pending count' do
post_create
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
expect(json_response['count']).to eq 1
expect(json_response['delete_path']).to match(%r{/dashboard/todos/\d{1}})
end
@@ -31,7 +31,7 @@ shared_examples 'todos actions' do
post_create
end.to change { user.todos.count }.by(0)
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
it 'does not create todo when user is not logged in' do
@@ -39,7 +39,7 @@ shared_examples 'todos actions' do
post_create
end.to change { user.todos.count }.by(0)
- expect(response).to have_gitlab_http_status(302)
+ expect(response).to have_gitlab_http_status(:found)
end
end
end
diff --git a/spec/support/shared_examples/controllers/uploads_actions_shared_examples.rb b/spec/support/shared_examples/controllers/uploads_actions_shared_examples.rb
index 8962d98218a..11dd8042b45 100644
--- a/spec/support/shared_examples/controllers/uploads_actions_shared_examples.rb
+++ b/spec/support/shared_examples/controllers/uploads_actions_shared_examples.rb
@@ -27,7 +27,7 @@ shared_examples 'handle uploads' do
it "returns an error" do
post :create, params: params, format: :json
- expect(response).to have_gitlab_http_status(422)
+ expect(response).to have_gitlab_http_status(:unprocessable_entity)
end
end
@@ -84,7 +84,7 @@ shared_examples 'handle uploads' do
show_upload
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
end
@@ -110,7 +110,7 @@ shared_examples 'handle uploads' do
it "responds with status 200" do
show_upload
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
end
@@ -123,7 +123,7 @@ shared_examples 'handle uploads' do
it "responds with status 404" do
show_upload
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
end
@@ -135,7 +135,7 @@ shared_examples 'handle uploads' do
it "responds with status 404" do
show_upload
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
end
end
@@ -149,7 +149,7 @@ shared_examples 'handle uploads' do
it "responds with status 200" do
show_upload
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
end
@@ -161,7 +161,7 @@ shared_examples 'handle uploads' do
it "responds with status 404" do
show_upload
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
end
end
@@ -182,7 +182,7 @@ shared_examples 'handle uploads' do
it "responds with status 200" do
show_upload
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
end
@@ -226,7 +226,7 @@ shared_examples 'handle uploads' do
it "responds with status 200" do
show_upload
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
end
@@ -238,7 +238,7 @@ shared_examples 'handle uploads' do
it "responds with status 404" do
show_upload
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
end
end
@@ -253,7 +253,7 @@ shared_examples 'handle uploads' do
it "responds with status 200" do
show_upload
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
end
@@ -265,7 +265,7 @@ shared_examples 'handle uploads' do
it "responds with status 404" do
show_upload
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
end
end
@@ -278,7 +278,7 @@ shared_examples 'handle uploads' do
it "responds with status 404" do
show_upload
- expect(response).to have_gitlab_http_status(404)
+ expect(response).to have_gitlab_http_status(:not_found)
end
end
end
@@ -321,7 +321,7 @@ shared_examples 'handle uploads authorize' do
end
it 'responds with status 200' do
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
end
it 'uses the gitlab-workhorse content type' do