From 885275c832d7c76b7290b38190a6cf31438d3898 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 15 Mar 2023 21:14:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/requests/api/files_spec.rb | 21 ----- spec/requests/api/issues/get_group_issues_spec.rb | 30 ++++---- .../requests/api/issues/get_project_issues_spec.rb | 42 +++++----- spec/requests/api/issues/issues_spec.rb | 60 +++++++-------- .../api/issues/post_projects_issues_spec.rb | 90 +++++++++++----------- .../api/issues/put_projects_issues_spec.rb | 62 +++++++-------- spec/requests/api/pages/internal_access_spec.rb | 68 ++++++++-------- spec/requests/api/pages/pages_spec.rb | 12 +-- spec/requests/api/pages/private_access_spec.rb | 68 ++++++++-------- spec/requests/api/pages/public_access_spec.rb | 68 ++++++++-------- spec/requests/api/pages_domains_spec.rb | 40 +++++----- 11 files changed, 270 insertions(+), 291 deletions(-) (limited to 'spec/requests/api') diff --git a/spec/requests/api/files_spec.rb b/spec/requests/api/files_spec.rb index c9341934ec9..ed84e3e5f48 100644 --- a/spec/requests/api/files_spec.rb +++ b/spec/requests/api/files_spec.rb @@ -157,27 +157,6 @@ RSpec.describe API::Files, feature_category: :source_code_management do head api(route(file_path), current_user, **options), params: params end - context 'when feature flag "cache_client_with_metrics" is disabled' do - before do - stub_feature_flags(cache_client_with_metrics: false) - end - - it 'caches sha256 of the content', :use_clean_rails_redis_caching do - head api(route(file_path), current_user, **options), params: params - - expect(Gitlab::Cache::Client).not_to receive(:build_with_metadata) - - expect(Rails.cache.fetch("blob_content_sha256:#{project.full_path}:#{response.headers['X-Gitlab-Blob-Id']}")) - .to eq(content_sha256) - - expect_next_instance_of(Gitlab::Git::Blob) do |instance| - expect(instance).not_to receive(:load_all_data!) - end - - head api(route(file_path), current_user, **options), params: params - end - end - it 'returns file by commit sha' do # This file is deleted on HEAD file_path = 'files%2Fjs%2Fcommit%2Ejs%2Ecoffee' diff --git a/spec/requests/api/issues/get_group_issues_spec.rb b/spec/requests/api/issues/get_group_issues_spec.rb index 0641c2135c1..eaa3c46d0ca 100644 --- a/spec/requests/api/issues/get_group_issues_spec.rb +++ b/spec/requests/api/issues/get_group_issues_spec.rb @@ -74,7 +74,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do let(:base_url) { "/groups/#{group.id}/issues" } shared_examples 'group issues statistics' do - it 'returns issues statistics' do + it 'returns issues statistics', :aggregate_failures do get api("/groups/#{group.id}/issues_statistics", user), params: params expect(response).to have_gitlab_http_status(:ok) @@ -346,7 +346,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do group_project.add_reporter(user) end - it 'exposes known attributes' do + it 'exposes known attributes', :aggregate_failures do get api(base_url, admin) expect(response).to have_gitlab_http_status(:ok) @@ -355,7 +355,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end it 'returns all group issues (including opened and closed)' do - get api(base_url, admin) + get api(base_url, admin, admin_mode: true) expect_paginated_array_response([group_closed_issue.id, group_confidential_issue.id, group_issue.id]) end @@ -385,7 +385,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end it 'returns group confidential issues for admin' do - get api(base_url, admin), params: { state: :opened } + get api(base_url, admin, admin_mode: true), params: { state: :opened } expect_paginated_array_response([group_confidential_issue.id, group_issue.id]) end @@ -403,7 +403,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'labels parameter' do - it 'returns an array of labeled group issues' do + it 'returns an array of labeled group issues', :aggregate_failures do get api(base_url, user), params: { labels: group_label.title } expect_paginated_array_response(group_issue.id) @@ -486,7 +486,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'returns an array of issues found by iids' do + it 'returns an array of issues found by iids', :aggregate_failures do get api(base_url, user), params: { iids: [group_issue.iid] } expect_paginated_array_response(group_issue.id) @@ -505,14 +505,14 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect_paginated_array_response([]) end - it 'returns an array of group issues with any label' do + it 'returns an array of group issues with any label', :aggregate_failures do get api(base_url, user), params: { labels: IssuableFinder::Params::FILTER_ANY } expect_paginated_array_response(group_issue.id) expect(json_response.first['id']).to eq(group_issue.id) end - it 'returns an array of group issues with any label with labels param as array' do + it 'returns an array of group issues with any label with labels param as array', :aggregate_failures do get api(base_url, user), params: { labels: [IssuableFinder::Params::FILTER_ANY] } expect_paginated_array_response(group_issue.id) @@ -555,7 +555,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect_paginated_array_response(group_closed_issue.id) end - it 'returns an array of issues with no milestone' do + it 'returns an array of issues with no milestone', :aggregate_failures do get api(base_url, user), params: { milestone: no_milestone_title } expect(response).to have_gitlab_http_status(:ok) @@ -688,28 +688,28 @@ RSpec.describe API::Issues, feature_category: :team_planning do let!(:issue2) { create(:issue, author: user2, project: group_project, created_at: 2.days.ago) } let!(:issue3) { create(:issue, author: user2, assignees: [assignee, another_assignee], project: group_project, created_at: 1.day.ago) } - it 'returns issues with by assignee_username' do + it 'returns issues with by assignee_username', :aggregate_failures do get api(base_url, user), params: { assignee_username: [assignee.username], scope: 'all' } expect(issue3.reload.assignees.pluck(:id)).to match_array([assignee.id, another_assignee.id]) expect_paginated_array_response([issue3.id, group_confidential_issue.id]) end - it 'returns issues by assignee_username as string' do + it 'returns issues by assignee_username as string', :aggregate_failures do get api(base_url, user), params: { assignee_username: assignee.username, scope: 'all' } expect(issue3.reload.assignees.pluck(:id)).to match_array([assignee.id, another_assignee.id]) expect_paginated_array_response([issue3.id, group_confidential_issue.id]) end - it 'returns error when multiple assignees are passed' do + it 'returns error when multiple assignees are passed', :aggregate_failures do get api(base_url, user), params: { assignee_username: [assignee.username, another_assignee.username], scope: 'all' } expect(response).to have_gitlab_http_status(:bad_request) expect(json_response["error"]).to include("allows one value, but found 2") end - it 'returns error when assignee_username and assignee_id are passed together' do + it 'returns error when assignee_username and assignee_id are passed together', :aggregate_failures do get api(base_url, user), params: { assignee_username: [assignee.username], assignee_id: another_assignee.id, scope: 'all' } expect(response).to have_gitlab_http_status(:bad_request) @@ -719,7 +719,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end describe "#to_reference" do - it 'exposes reference path in context of group' do + it 'exposes reference path in context of group', :aggregate_failures do get api(base_url, user) expect(json_response.first['references']['short']).to eq("##{group_closed_issue.iid}") @@ -735,7 +735,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do group_closed_issue.reload end - it 'exposes reference path in context of parent group' do + it 'exposes reference path in context of parent group', :aggregate_failures do get api("/groups/#{parent_group.id}/issues") expect(json_response.first['references']['short']).to eq("##{group_closed_issue.iid}") diff --git a/spec/requests/api/issues/get_project_issues_spec.rb b/spec/requests/api/issues/get_project_issues_spec.rb index 6fc3903103b..915b8fff75e 100644 --- a/spec/requests/api/issues/get_project_issues_spec.rb +++ b/spec/requests/api/issues/get_project_issues_spec.rb @@ -99,7 +99,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end shared_examples 'project issues statistics' do - it 'returns project issues statistics' do + it 'returns project issues statistics', :aggregate_failures do get api("/projects/#{project.id}/issues_statistics", current_user), params: params expect(response).to have_gitlab_http_status(:ok) @@ -317,7 +317,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end it 'returns project confidential issues for admin' do - get api("#{base_url}/issues", admin) + get api("#{base_url}/issues", admin, admin_mode: true) expect_paginated_array_response([issue.id, confidential_issue.id, closed_issue.id]) end @@ -526,7 +526,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect_paginated_array_response([closed_issue.id, confidential_issue.id, issue.id]) end - it 'exposes known attributes' do + it 'exposes known attributes', :aggregate_failures do get api("#{base_url}/issues", user) expect(response).to have_gitlab_http_status(:ok) @@ -607,28 +607,28 @@ RSpec.describe API::Issues, feature_category: :team_planning do let!(:issue2) { create(:issue, author: user2, project: project, created_at: 2.days.ago) } let!(:issue3) { create(:issue, author: user2, assignees: [assignee, another_assignee], project: project, created_at: 1.day.ago) } - it 'returns issues by assignee_username' do + it 'returns issues by assignee_username', :aggregate_failures do get api("/issues", user), params: { assignee_username: [assignee.username], scope: 'all' } expect(issue3.reload.assignees.pluck(:id)).to match_array([assignee.id, another_assignee.id]) expect_paginated_array_response([confidential_issue.id, issue3.id]) end - it 'returns issues by assignee_username as string' do + it 'returns issues by assignee_username as string', :aggregate_failures do get api("/issues", user), params: { assignee_username: assignee.username, scope: 'all' } expect(issue3.reload.assignees.pluck(:id)).to match_array([assignee.id, another_assignee.id]) expect_paginated_array_response([confidential_issue.id, issue3.id]) end - it 'returns error when multiple assignees are passed' do + it 'returns error when multiple assignees are passed', :aggregate_failures do get api("/issues", user), params: { assignee_username: [assignee.username, another_assignee.username], scope: 'all' } expect(response).to have_gitlab_http_status(:bad_request) expect(json_response["error"]).to include("allows one value, but found 2") end - it 'returns error when assignee_username and assignee_id are passed together' do + it 'returns error when assignee_username and assignee_id are passed together', :aggregate_failures do get api("/issues", user), params: { assignee_username: [assignee.username], assignee_id: another_assignee.id, scope: 'all' } expect(response).to have_gitlab_http_status(:bad_request) @@ -646,7 +646,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'exposes known attributes' do + it 'exposes known attributes', :aggregate_failures do get api("/projects/#{project.id}/issues/#{issue.iid}", user) expect(response).to have_gitlab_http_status(:ok) @@ -686,7 +686,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'exposes the closed_at attribute' do + it 'exposes the closed_at attribute', :aggregate_failures do get api("/projects/#{project.id}/issues/#{closed_issue.iid}", user) expect(response).to have_gitlab_http_status(:ok) @@ -694,7 +694,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'links exposure' do - it 'exposes related resources full URIs' do + it 'exposes related resources full URIs', :aggregate_failures do get api("/projects/#{project.id}/issues/#{issue.iid}", user) links = json_response['_links'] @@ -706,7 +706,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'returns a project issue by internal id' do + it 'returns a project issue by internal id', :aggregate_failures do get api("/projects/#{project.id}/issues/#{issue.iid}", user) expect(response).to have_gitlab_http_status(:ok) @@ -738,7 +738,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(response).to have_gitlab_http_status(:not_found) end - it 'returns confidential issue for project members' do + it 'returns confidential issue for project members', :aggregate_failures do get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", user) expect(response).to have_gitlab_http_status(:ok) @@ -746,7 +746,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['iid']).to eq(confidential_issue.iid) end - it 'returns confidential issue for author' do + it 'returns confidential issue for author', :aggregate_failures do get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", author) expect(response).to have_gitlab_http_status(:ok) @@ -754,7 +754,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['iid']).to eq(confidential_issue.iid) end - it 'returns confidential issue for assignee' do + it 'returns confidential issue for assignee', :aggregate_failures do get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", assignee) expect(response).to have_gitlab_http_status(:ok) @@ -762,8 +762,8 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['iid']).to eq(confidential_issue.iid) end - it 'returns confidential issue for admin' do - get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", admin) + it 'returns confidential issue for admin', :aggregate_failures do + get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", admin, admin_mode: true) expect(response).to have_gitlab_http_status(:ok) expect(json_response['title']).to eq(confidential_issue.title) @@ -829,7 +829,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do let!(:related_mr) { create_referencing_mr(user, project, issue) } context 'when unauthenticated' do - it 'return list of referenced merge requests from issue' do + it 'return list of referenced merge requests from issue', :aggregate_failures do get_related_merge_requests(project.id, issue.iid) expect_paginated_array_response(related_mr.id) @@ -898,8 +898,8 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'exposes known attributes' do - get api("/projects/#{project.id}/issues/#{issue.iid}/user_agent_detail", admin) + it 'exposes known attributes', :aggregate_failures do + get api("/projects/#{project.id}/issues/#{issue.iid}/user_agent_detail", admin, admin_mode: true) expect(response).to have_gitlab_http_status(:ok) expect(json_response['user_agent']).to eq(user_agent_detail.user_agent) @@ -936,7 +936,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do ) end - it 'returns a full list of participants' do + it 'returns a full list of participants', :aggregate_failures do get api("/projects/#{project.id}/issues/#{issue.iid}/participants", user) expect(response).to have_gitlab_http_status(:ok) @@ -945,7 +945,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when user cannot see a confidential note' do - it 'returns a limited list of participants' do + it 'returns a limited list of participants', :aggregate_failures do get api("/projects/#{project.id}/issues/#{issue.iid}/participants", create(:user)) expect(response).to have_gitlab_http_status(:ok) diff --git a/spec/requests/api/issues/issues_spec.rb b/spec/requests/api/issues/issues_spec.rb index 078f00334c3..33f49cefc69 100644 --- a/spec/requests/api/issues/issues_spec.rb +++ b/spec/requests/api/issues/issues_spec.rb @@ -78,7 +78,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end shared_examples 'issues statistics' do - it 'returns issues statistics' do + it 'returns issues statistics', :aggregate_failures do get api("/issues_statistics", user), params: params expect(response).to have_gitlab_http_status(:ok) @@ -109,8 +109,8 @@ RSpec.describe API::Issues, feature_category: :team_planning do context 'as an admin' do context 'when issue exists' do - it 'returns the issue' do - get api("/issues/#{issue.id}", admin) + it 'returns the issue', :aggregate_failures do + get api("/issues/#{issue.id}", admin, admin_mode: true) expect(response).to have_gitlab_http_status(:ok) expect(json_response.dig('author', 'id')).to eq(issue.author.id) @@ -121,7 +121,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do context 'when issue does not exist' do it 'returns 404' do - get api("/issues/0", admin) + get api("/issues/0", admin, admin_mode: true) expect(response).to have_gitlab_http_status(:not_found) end @@ -132,7 +132,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do describe 'GET /issues' do context 'when unauthenticated' do - it 'returns an array of all issues' do + it 'returns an array of all issues', :aggregate_failures do get api('/issues'), params: { scope: 'all' } expect(response).to have_gitlab_http_status(:ok) @@ -162,14 +162,14 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(response).to have_gitlab_http_status(:unauthorized) end - it 'returns an array of issues matching state in milestone' do + it 'returns an array of issues matching state in milestone', :aggregate_failures do get api('/issues'), params: { milestone: 'foo', scope: 'all' } expect(response).to have_gitlab_http_status(:ok) expect_paginated_array_response([]) end - it 'returns an array of issues matching state in milestone' do + it 'returns an array of issues matching state in milestone', :aggregate_failures do get api('/issues'), params: { milestone: milestone.title, scope: 'all' } expect(response).to have_gitlab_http_status(:ok) @@ -273,7 +273,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when authenticated' do - it 'returns an array of issues' do + it 'returns an array of issues', :aggregate_failures do get api('/issues', user) expect_paginated_array_response([issue.id, closed_issue.id]) @@ -532,7 +532,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do context 'with incident issues' do let_it_be(:incident) { create(:incident, project: project) } - it 'avoids N+1 queries' do + it 'avoids N+1 queries', :aggregate_failures do get api('/issues', user) # warm up control = ActiveRecord::QueryRecorder.new do @@ -553,7 +553,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do context 'with issues closed as duplicates' do let_it_be(:dup_issue_1) { create(:issue, :closed_as_duplicate, project: project) } - it 'avoids N+1 queries' do + it 'avoids N+1 queries', :aggregate_failures do get api('/issues', user) # warm up control = ActiveRecord::QueryRecorder.new do @@ -639,7 +639,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect_paginated_array_response([]) end - it 'returns an array of labeled issues matching given state' do + it 'returns an array of labeled issues matching given state', :aggregate_failures do get api('/issues', user), params: { labels: label.title, state: :opened } expect_paginated_array_response(issue.id) @@ -647,7 +647,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response.first['state']).to eq('opened') end - it 'returns an array of labeled issues matching given state with labels param as array' do + it 'returns an array of labeled issues matching given state with labels param as array', :aggregate_failures do get api('/issues', user), params: { labels: [label.title], state: :opened } expect_paginated_array_response(issue.id) @@ -917,14 +917,14 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'matches V4 response schema' do + it 'matches V4 response schema', :aggregate_failures do get api('/issues', user) expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('public_api/v4/issues') end - it 'returns a related merge request count of 0 if there are no related merge requests' do + it 'returns a related merge request count of 0 if there are no related merge requests', :aggregate_failures do get api('/issues', user) expect(response).to have_gitlab_http_status(:ok) @@ -932,7 +932,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response.first).to include('merge_requests_count' => 0) end - it 'returns a related merge request count > 0 if there are related merge requests' do + it 'returns a related merge request count > 0 if there are related merge requests', :aggregate_failures do create(:merge_requests_closing_issues, issue: issue) get api('/issues', user) @@ -1013,28 +1013,28 @@ RSpec.describe API::Issues, feature_category: :team_planning do let!(:issue2) { create(:issue, author: user2, project: project, created_at: 2.days.ago) } let!(:issue3) { create(:issue, author: user2, assignees: [assignee, another_assignee], project: project, created_at: 1.day.ago) } - it 'returns issues with by assignee_username' do + it 'returns issues with by assignee_username', :aggregate_failures do get api("/issues", user), params: { assignee_username: [assignee.username], scope: 'all' } expect(issue3.reload.assignees.pluck(:id)).to match_array([assignee.id, another_assignee.id]) expect_paginated_array_response([confidential_issue.id, issue3.id]) end - it 'returns issues by assignee_username as string' do + it 'returns issues by assignee_username as string', :aggregate_failures do get api("/issues", user), params: { assignee_username: assignee.username, scope: 'all' } expect(issue3.reload.assignees.pluck(:id)).to match_array([assignee.id, another_assignee.id]) expect_paginated_array_response([confidential_issue.id, issue3.id]) end - it 'returns error when multiple assignees are passed' do + it 'returns error when multiple assignees are passed', :aggregate_failures do get api("/issues", user), params: { assignee_username: [assignee.username, another_assignee.username], scope: 'all' } expect(response).to have_gitlab_http_status(:bad_request) expect(json_response["error"]).to include("allows one value, but found 2") end - it 'returns error when assignee_username and assignee_id are passed together' do + it 'returns error when assignee_username and assignee_id are passed together', :aggregate_failures do get api("/issues", user), params: { assignee_username: [assignee.username], assignee_id: another_assignee.id, scope: 'all' } expect(response).to have_gitlab_http_status(:bad_request) @@ -1088,7 +1088,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end describe 'GET /projects/:id/issues/:issue_iid' do - it 'exposes full reference path' do + it 'exposes full reference path', :aggregate_failures do get api("/projects/#{project.id}/issues/#{issue.iid}", user) expect(response).to have_gitlab_http_status(:ok) @@ -1106,7 +1106,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'user does not have permission to view new issue' do - it 'does not return the issue as closed_as_duplicate_of' do + it 'does not return the issue as closed_as_duplicate_of', :aggregate_failures do get api("/projects/#{project.id}/issues/#{issue_closed_as_dup.iid}", user) expect(response).to have_gitlab_http_status(:ok) @@ -1119,7 +1119,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do new_issue.project.add_guest(user) end - it 'returns the issue as closed_as_duplicate_of' do + it 'returns the issue as closed_as_duplicate_of', :aggregate_failures do get api("/projects/#{project.id}/issues/#{issue_closed_as_dup.iid}", user) expect(response).to have_gitlab_http_status(:ok) @@ -1131,7 +1131,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end describe "POST /projects/:id/issues" do - it 'creates a new project issue' do + it 'creates a new project issue', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue' } expect(response).to have_gitlab_http_status(:created) @@ -1140,7 +1140,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when confidential is null' do - it 'responds with 400 error' do + it 'responds with 400 error', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'issue', confidential: nil } expect(response).to have_gitlab_http_status(:bad_request) @@ -1155,7 +1155,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'returns and error message and status code from the service' do + it 'returns and error message and status code from the service', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue' } expect(response).to have_gitlab_http_status(:forbidden) @@ -1177,15 +1177,15 @@ RSpec.describe API::Issues, feature_category: :team_planning do travel_to fixed_time end - it 'allows admins to set the timestamp' do - put api("/projects/#{project.id}/issues/#{issue.iid}", admin), params: { labels: 'label1', updated_at: updated_at } + it 'allows admins to set the timestamp', :aggregate_failures do + put api("/projects/#{project.id}/issues/#{issue.iid}", admin, admin_mode: true), params: { labels: 'label1', updated_at: updated_at } expect(response).to have_gitlab_http_status(:ok) expect(Time.parse(json_response['updated_at'])).to be_like_time(updated_at) expect(ResourceLabelEvent.last.created_at).to be_like_time(updated_at) end - it 'does not allow other users to set the timestamp' do + it 'does not allow other users to set the timestamp', :aggregate_failures do reporter = create(:user) project.add_developer(reporter) @@ -1268,7 +1268,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'with valid params' do - it 'reorders issues and returns a successful 200 response' do + it 'reorders issues and returns a successful 200 response', :aggregate_failures do put api("/projects/#{project.id}/issues/#{issue1.iid}/reorder", user), params: { move_after_id: issue2.id, move_before_id: issue3.id } expect(response).to have_gitlab_http_status(:ok) @@ -1295,7 +1295,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do let(:other_project) { create(:project, group: group) } let(:other_issue) { create(:issue, project: other_project, relative_position: 80) } - it 'reorders issues and returns a successful 200 response' do + it 'reorders issues and returns a successful 200 response', :aggregate_failures do put api("/projects/#{other_project.id}/issues/#{other_issue.iid}/reorder", user), params: { move_after_id: issue2.id, move_before_id: issue3.id } expect(response).to have_gitlab_http_status(:ok) diff --git a/spec/requests/api/issues/post_projects_issues_spec.rb b/spec/requests/api/issues/post_projects_issues_spec.rb index 265091fa698..a17c1389e83 100644 --- a/spec/requests/api/issues/post_projects_issues_spec.rb +++ b/spec/requests/api/issues/post_projects_issues_spec.rb @@ -75,7 +75,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do describe 'POST /projects/:id/issues' do context 'support for deprecated assignee_id' do - it 'creates a new project issue' do + it 'creates a new project issue', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', assignee_id: user2.id } @@ -85,7 +85,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['assignees'].first['name']).to eq(user2.name) end - it 'creates a new project issue when assignee_id is empty' do + it 'creates a new project issue when assignee_id is empty', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', assignee_id: '' } @@ -96,7 +96,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'single assignee restrictions' do - it 'creates a new project issue with no more than one assignee' do + it 'creates a new project issue with no more than one assignee', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', assignee_ids: [user2.id, guest.id] } @@ -122,8 +122,8 @@ RSpec.describe API::Issues, feature_category: :team_planning do context 'an internal ID is provided' do context 'by an admin' do - it 'sets the internal ID on the new issue' do - post api("/projects/#{project.id}/issues", admin), + it 'sets the internal ID on the new issue', :aggregate_failures do + post api("/projects/#{project.id}/issues", admin, admin_mode: true), params: { title: 'new issue', iid: 9001 } expect(response).to have_gitlab_http_status(:created) @@ -132,7 +132,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'by an owner' do - it 'sets the internal ID on the new issue' do + it 'sets the internal ID on the new issue', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', iid: 9001 } @@ -145,7 +145,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do let(:group) { create(:group) } let(:group_project) { create(:project, :public, namespace: group) } - it 'sets the internal ID on the new issue' do + it 'sets the internal ID on the new issue', :aggregate_failures do group.add_owner(user2) post api("/projects/#{group_project.id}/issues", user2), params: { title: 'new issue', iid: 9001 } @@ -156,7 +156,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'by another user' do - it 'ignores the given internal ID' do + it 'ignores the given internal ID', :aggregate_failures do post api("/projects/#{project.id}/issues", user2), params: { title: 'new issue', iid: 9001 } @@ -166,8 +166,8 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when an issue with the same IID exists on database' do - it 'returns 409' do - post api("/projects/#{project.id}/issues", admin), + it 'returns 409', :aggregate_failures do + post api("/projects/#{project.id}/issues", admin, admin_mode: true), params: { title: 'new issue', iid: issue.iid } expect(response).to have_gitlab_http_status(:conflict) @@ -176,7 +176,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'creates a new project issue' do + it 'creates a new project issue', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', labels: 'label, label2', weight: 3, assignee_ids: [user2.id] } @@ -189,7 +189,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['assignees'].first['name']).to eq(user2.name) end - it 'creates a new project issue with labels param as array' do + it 'creates a new project issue with labels param as array', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', labels: %w(label label2), weight: 3, assignee_ids: [user2.id] } @@ -202,7 +202,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['assignees'].first['name']).to eq(user2.name) end - it 'creates a new confidential project issue' do + it 'creates a new confidential project issue', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', confidential: true } @@ -211,7 +211,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['confidential']).to be_truthy end - it 'creates a new confidential project issue with a different param' do + it 'creates a new confidential project issue with a different param', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', confidential: 'y' } @@ -220,7 +220,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['confidential']).to be_truthy end - it 'creates a public issue when confidential param is false' do + it 'creates a public issue when confidential param is false', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', confidential: false } @@ -229,7 +229,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['confidential']).to be_falsy end - it 'creates a public issue when confidential param is invalid' do + it 'creates a public issue when confidential param is invalid', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', confidential: 'foo' } @@ -242,7 +242,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(response).to have_gitlab_http_status(:bad_request) end - it 'allows special label names' do + it 'allows special label names', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', @@ -256,7 +256,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['labels']).to include '&' end - it 'allows special label names with labels param as array' do + it 'allows special label names with labels param as array', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'new issue', @@ -270,7 +270,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['labels']).to include '&' end - it 'returns 400 if title is too long' do + it 'returns 400 if title is too long', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: { title: 'g' * 256 } expect(response).to have_gitlab_http_status(:bad_request) @@ -313,7 +313,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'with due date' do - it 'creates a new project issue' do + it 'creates a new project issue', :aggregate_failures do due_date = 2.weeks.from_now.strftime('%Y-%m-%d') post api("/projects/#{project.id}/issues", user), @@ -336,8 +336,8 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'by an admin' do - it 'sets the creation time on the new issue' do - post api("/projects/#{project.id}/issues", admin), params: params + it 'sets the creation time on the new issue', :aggregate_failures do + post api("/projects/#{project.id}/issues", admin, admin_mode: true), params: params expect(response).to have_gitlab_http_status(:created) expect(Time.parse(json_response['created_at'])).to be_like_time(creation_time) @@ -346,7 +346,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'by a project owner' do - it 'sets the creation time on the new issue' do + it 'sets the creation time on the new issue', :aggregate_failures do post api("/projects/#{project.id}/issues", user), params: params expect(response).to have_gitlab_http_status(:created) @@ -356,7 +356,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'by a group owner' do - it 'sets the creation time on the new issue' do + it 'sets the creation time on the new issue', :aggregate_failures do group = create(:group) group_project = create(:project, :public, namespace: group) group.add_owner(user2) @@ -370,7 +370,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'by another user' do - it 'ignores the given creation time' do + it 'ignores the given creation time', :aggregate_failures do project.add_developer(user2) post api("/projects/#{project.id}/issues", user2), params: params @@ -397,7 +397,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when request exceeds the rate limit' do - it 'prevents users from creating more issues' do + it 'prevents users from creating more issues', :aggregate_failures do allow(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).and_return(true) post api("/projects/#{project.id}/issues", user), @@ -437,7 +437,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect { post_issue }.not_to change(Issue, :count) end - it 'returns correct status and message' do + it 'returns correct status and message', :aggregate_failures do post_issue expect(response).to have_gitlab_http_status(:bad_request) @@ -476,7 +476,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do let!(:target_project) { create(:project, creator_id: user.id, namespace: user.namespace) } let!(:target_project2) { create(:project, creator_id: non_member.id, namespace: non_member.namespace) } - it 'moves an issue' do + it 'moves an issue', :aggregate_failures do post api("/projects/#{project.id}/issues/#{issue.iid}/move", user), params: { to_project_id: target_project.id } @@ -485,7 +485,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when source and target projects are the same' do - it 'returns 400 when trying to move an issue' do + it 'returns 400 when trying to move an issue', :aggregate_failures do post api("/projects/#{project.id}/issues/#{issue.iid}/move", user), params: { to_project_id: project.id } @@ -495,7 +495,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when the user does not have the permission to move issues' do - it 'returns 400 when trying to move an issue' do + it 'returns 400 when trying to move an issue', :aggregate_failures do post api("/projects/#{project.id}/issues/#{issue.iid}/move", user), params: { to_project_id: target_project2.id } @@ -504,8 +504,8 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'moves the issue to another namespace if I am admin' do - post api("/projects/#{project.id}/issues/#{issue.iid}/move", admin), + it 'moves the issue to another namespace if I am admin', :aggregate_failures do + post api("/projects/#{project.id}/issues/#{issue.iid}/move", admin, admin_mode: true), params: { to_project_id: target_project2.id } expect(response).to have_gitlab_http_status(:created) @@ -513,7 +513,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when using the issue ID instead of iid' do - it 'returns 404 when trying to move an issue', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/341520' do + it 'returns 404 when trying to move an issue', :aggregate_failures, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/341520' do post api("/projects/#{project.id}/issues/#{issue.id}/move", user), params: { to_project_id: target_project.id } @@ -523,7 +523,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when issue does not exist' do - it 'returns 404 when trying to move an issue' do + it 'returns 404 when trying to move an issue', :aggregate_failures do post api("/projects/#{project.id}/issues/123/move", user), params: { to_project_id: target_project.id } @@ -533,7 +533,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when source project does not exist' do - it 'returns 404 when trying to move an issue' do + it 'returns 404 when trying to move an issue', :aggregate_failures do post api("/projects/0/issues/#{issue.iid}/move", user), params: { to_project_id: target_project.id } @@ -562,7 +562,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do context 'when user can admin the issue' do context 'when the user can admin the target project' do - it 'clones the issue' do + it 'clones the issue', :aggregate_failures do expect do post_clone_issue(user, issue, valid_target_project) end.to change { valid_target_project.issues.count }.by(1) @@ -577,7 +577,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when target project is the same source project' do - it 'clones the issue' do + it 'clones the issue', :aggregate_failures do expect do post_clone_issue(user, issue, issue.project) end.to change { issue.reset.project.issues.count }.by(1) @@ -595,7 +595,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when the user does not have the permission to clone issues' do - it 'returns 400' do + it 'returns 400', :aggregate_failures do post api("/projects/#{project.id}/issues/#{issue.iid}/clone", user), params: { to_project_id: invalid_target_project.id } @@ -605,7 +605,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when using the issue ID instead of iid' do - it 'returns 404', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/341520' do + it 'returns 404', :aggregate_failures, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/341520' do post api("/projects/#{project.id}/issues/#{issue.id}/clone", user), params: { to_project_id: valid_target_project.id } @@ -615,7 +615,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when issue does not exist' do - it 'returns 404' do + it 'returns 404', :aggregate_failures do post api("/projects/#{project.id}/issues/12300/clone", user), params: { to_project_id: valid_target_project.id } @@ -625,7 +625,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when source project does not exist' do - it 'returns 404' do + it 'returns 404', :aggregate_failures do post api("/projects/0/issues/#{issue.iid}/clone", user), params: { to_project_id: valid_target_project.id } @@ -635,7 +635,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end context 'when target project does not exist' do - it 'returns 404' do + it 'returns 404', :aggregate_failures do post api("/projects/#{project.id}/issues/#{issue.iid}/clone", user), params: { to_project_id: 0 } @@ -644,7 +644,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'clones the issue with notes when with_notes is true' do + it 'clones the issue with notes when with_notes is true', :aggregate_failures do expect do post api("/projects/#{project.id}/issues/#{issue.iid}/clone", user), params: { to_project_id: valid_target_project.id, with_notes: true } @@ -661,7 +661,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end describe 'POST :id/issues/:issue_iid/subscribe' do - it 'subscribes to an issue' do + it 'subscribes to an issue', :aggregate_failures do post api("/projects/#{project.id}/issues/#{issue.iid}/subscribe", user2) expect(response).to have_gitlab_http_status(:created) @@ -694,7 +694,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end describe 'POST :id/issues/:issue_id/unsubscribe' do - it 'unsubscribes from an issue' do + it 'unsubscribes from an issue', :aggregate_failures do post api("/projects/#{project.id}/issues/#{issue.iid}/unsubscribe", user) expect(response).to have_gitlab_http_status(:created) diff --git a/spec/requests/api/issues/put_projects_issues_spec.rb b/spec/requests/api/issues/put_projects_issues_spec.rb index f0d174c9e78..6cc639c0bcc 100644 --- a/spec/requests/api/issues/put_projects_issues_spec.rb +++ b/spec/requests/api/issues/put_projects_issues_spec.rb @@ -80,7 +80,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end describe 'PUT /projects/:id/issues/:issue_iid to update only title' do - it 'updates a project issue' do + it 'updates a project issue', :aggregate_failures do put api_for_user, params: { title: updated_title } expect(response).to have_gitlab_http_status(:ok) @@ -109,7 +109,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(response).to have_gitlab_http_status(:ok) end - it 'allows special label names with labels param as array' do + it 'allows special label names with labels param as array', :aggregate_failures do put api_for_user, params: { title: updated_title, @@ -135,42 +135,42 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(response).to have_gitlab_http_status(:forbidden) end - it 'updates a confidential issue for project members' do + it 'updates a confidential issue for project members', :aggregate_failures do put api(confidential_issue_path, user), params: { title: updated_title } expect(response).to have_gitlab_http_status(:ok) expect(json_response['title']).to eq(updated_title) end - it 'updates a confidential issue for author' do + it 'updates a confidential issue for author', :aggregate_failures do put api(confidential_issue_path, author), params: { title: updated_title } expect(response).to have_gitlab_http_status(:ok) expect(json_response['title']).to eq(updated_title) end - it 'updates a confidential issue for admin' do - put api(confidential_issue_path, admin), params: { title: updated_title } + it 'updates a confidential issue for admin', :aggregate_failures do + put api(confidential_issue_path, admin, admin_mode: true), params: { title: updated_title } expect(response).to have_gitlab_http_status(:ok) expect(json_response['title']).to eq(updated_title) end - it 'sets an issue to confidential' do + it 'sets an issue to confidential', :aggregate_failures do put api_for_user, params: { confidential: true } expect(response).to have_gitlab_http_status(:ok) expect(json_response['confidential']).to be_truthy end - it 'makes a confidential issue public' do + it 'makes a confidential issue public', :aggregate_failures do put api(confidential_issue_path, user), params: { confidential: false } expect(response).to have_gitlab_http_status(:ok) expect(json_response['confidential']).to be_falsy end - it 'does not update a confidential issue with wrong confidential flag' do + it 'does not update a confidential issue with wrong confidential flag', :aggregate_failures do put api(confidential_issue_path, user), params: { confidential: 'foo' } expect(response).to have_gitlab_http_status(:bad_request) @@ -209,7 +209,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect { update_issue }.not_to change { issue.reload.title } end - it 'returns correct status and message' do + it 'returns correct status and message', :aggregate_failures do update_issue expect(response).to have_gitlab_http_status(:bad_request) @@ -246,14 +246,14 @@ RSpec.describe API::Issues, feature_category: :team_planning do describe 'PUT /projects/:id/issues/:issue_iid to update assignee' do context 'support for deprecated assignee_id' do - it 'removes assignee' do + it 'removes assignee', :aggregate_failures do put api_for_user, params: { assignee_id: 0 } expect(response).to have_gitlab_http_status(:ok) expect(json_response['assignee']).to be_nil end - it 'updates an issue with new assignee' do + it 'updates an issue with new assignee', :aggregate_failures do put api_for_user, params: { assignee_id: user2.id } expect(response).to have_gitlab_http_status(:ok) @@ -261,21 +261,21 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'removes assignee' do + it 'removes assignee', :aggregate_failures do put api_for_user, params: { assignee_ids: [0] } expect(response).to have_gitlab_http_status(:ok) expect(json_response['assignees']).to be_empty end - it 'updates an issue with new assignee' do + it 'updates an issue with new assignee', :aggregate_failures do put api_for_user, params: { assignee_ids: [user2.id] } expect(response).to have_gitlab_http_status(:ok) expect(json_response['assignees'].first['name']).to eq(user2.name) end - context 'single assignee restrictions' do + context 'single assignee restrictions', :aggregate_failures do it 'updates an issue with several assignees but only one has been applied' do put api_for_user, params: { assignee_ids: [user2.id, guest.id] } @@ -289,7 +289,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do let!(:label) { create(:label, title: 'dummy', project: project) } let!(:label_link) { create(:label_link, label: label, target: issue) } - it 'adds relevant labels' do + it 'adds relevant labels', :aggregate_failures do put api_for_user, params: { add_labels: '1, 2' } expect(response).to have_gitlab_http_status(:ok) @@ -300,14 +300,14 @@ RSpec.describe API::Issues, feature_category: :team_planning do let!(:label2) { create(:label, title: 'a-label', project: project) } let!(:label_link2) { create(:label_link, label: label2, target: issue) } - it 'removes relevant labels' do + it 'removes relevant labels', :aggregate_failures do put api_for_user, params: { remove_labels: label2.title } expect(response).to have_gitlab_http_status(:ok) expect(json_response['labels']).to eq([label.title]) end - it 'removes all labels' do + it 'removes all labels', :aggregate_failures do put api_for_user, params: { remove_labels: "#{label.title}, #{label2.title}" } expect(response).to have_gitlab_http_status(:ok) @@ -315,14 +315,14 @@ RSpec.describe API::Issues, feature_category: :team_planning do end end - it 'does not update labels if not present' do + it 'does not update labels if not present', :aggregate_failures do put api_for_user, params: { title: updated_title } expect(response).to have_gitlab_http_status(:ok) expect(json_response['labels']).to eq([label.title]) end - it 'removes all labels and touches the record' do + it 'removes all labels and touches the record', :aggregate_failures do travel_to(2.minutes.from_now) do put api_for_user, params: { labels: '' } end @@ -332,7 +332,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['updated_at']).to be > Time.current end - it 'removes all labels and touches the record with labels param as array' do + it 'removes all labels and touches the record with labels param as array', :aggregate_failures do travel_to(2.minutes.from_now) do put api_for_user, params: { labels: [''] } end @@ -342,7 +342,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['updated_at']).to be > Time.current end - it 'updates labels and touches the record' do + it 'updates labels and touches the record', :aggregate_failures do travel_to(2.minutes.from_now) do put api_for_user, params: { labels: 'foo,bar' } end @@ -352,7 +352,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['updated_at']).to be > Time.current end - it 'updates labels and touches the record with labels param as array' do + it 'updates labels and touches the record with labels param as array', :aggregate_failures do travel_to(2.minutes.from_now) do put api_for_user, params: { labels: %w(foo bar) } end @@ -363,21 +363,21 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['updated_at']).to be > Time.current end - it 'allows special label names' do + it 'allows special label names', :aggregate_failures do put api_for_user, params: { labels: 'label:foo, label-bar,label_bar,label/bar,label?bar,label&bar,?,&' } expect(response).to have_gitlab_http_status(:ok) expect(json_response['labels']).to contain_exactly('label:foo', 'label-bar', 'label_bar', 'label/bar', 'label?bar', 'label&bar', '?', '&') end - it 'allows special label names with labels param as array' do + it 'allows special label names with labels param as array', :aggregate_failures do put api_for_user, params: { labels: ['label:foo', 'label-bar', 'label_bar', 'label/bar,label?bar,label&bar,?,&'] } expect(response).to have_gitlab_http_status(:ok) expect(json_response['labels']).to contain_exactly('label:foo', 'label-bar', 'label_bar', 'label/bar', 'label?bar', 'label&bar', '?', '&') end - it 'returns 400 if title is too long' do + it 'returns 400 if title is too long', :aggregate_failures do put api_for_user, params: { title: 'g' * 256 } expect(response).to have_gitlab_http_status(:bad_request) @@ -386,7 +386,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end describe 'PUT /projects/:id/issues/:issue_iid to update state and label' do - it 'updates a project issue' do + it 'updates a project issue', :aggregate_failures do put api_for_user, params: { labels: 'label2', state_event: 'close' } expect(response).to have_gitlab_http_status(:ok) @@ -394,7 +394,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(json_response['state']).to eq 'closed' end - it 'reopens a project isssue' do + it 'reopens a project isssue', :aggregate_failures do put api(issue_path, user), params: { state_event: 'reopen' } expect(response).to have_gitlab_http_status(:ok) @@ -404,7 +404,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do describe 'PUT /projects/:id/issues/:issue_iid to update updated_at param' do context 'when reporter makes request' do - it 'accepts the update date to be set' do + it 'accepts the update date to be set', :aggregate_failures do update_time = 2.weeks.ago put api_for_user, params: { title: 'some new title', updated_at: update_time } @@ -436,7 +436,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do expect(response).to have_gitlab_http_status(:bad_request) end - it 'accepts the update date to be set' do + it 'accepts the update date to be set', :aggregate_failures do update_time = 2.weeks.ago put api_for_owner, params: { title: 'some new title', updated_at: update_time } @@ -448,7 +448,7 @@ RSpec.describe API::Issues, feature_category: :team_planning do end describe 'PUT /projects/:id/issues/:issue_iid to update due date' do - it 'creates a new project issue' do + it 'creates a new project issue', :aggregate_failures do due_date = 2.weeks.from_now.strftime('%Y-%m-%d') put api_for_user, params: { due_date: due_date } diff --git a/spec/requests/api/pages/internal_access_spec.rb b/spec/requests/api/pages/internal_access_spec.rb index fdc25ecdcd3..3e7837866ae 100644 --- a/spec/requests/api/pages/internal_access_spec.rb +++ b/spec/requests/api/pages/internal_access_spec.rb @@ -35,39 +35,39 @@ RSpec.describe "Internal Project Pages Access", feature_category: :pages do describe "GET /projects/:id/pages_access" do context 'access depends on the level' do - where(:pages_access_level, :with_user, :expected_result) do - ProjectFeature::DISABLED | "admin" | 403 - ProjectFeature::DISABLED | "owner" | 403 - ProjectFeature::DISABLED | "master" | 403 - ProjectFeature::DISABLED | "developer" | 403 - ProjectFeature::DISABLED | "reporter" | 403 - ProjectFeature::DISABLED | "guest" | 403 - ProjectFeature::DISABLED | "user" | 403 - ProjectFeature::DISABLED | nil | 404 - ProjectFeature::PUBLIC | "admin" | 200 - ProjectFeature::PUBLIC | "owner" | 200 - ProjectFeature::PUBLIC | "master" | 200 - ProjectFeature::PUBLIC | "developer" | 200 - ProjectFeature::PUBLIC | "reporter" | 200 - ProjectFeature::PUBLIC | "guest" | 200 - ProjectFeature::PUBLIC | "user" | 200 - ProjectFeature::PUBLIC | nil | 404 - ProjectFeature::ENABLED | "admin" | 200 - ProjectFeature::ENABLED | "owner" | 200 - ProjectFeature::ENABLED | "master" | 200 - ProjectFeature::ENABLED | "developer" | 200 - ProjectFeature::ENABLED | "reporter" | 200 - ProjectFeature::ENABLED | "guest" | 200 - ProjectFeature::ENABLED | "user" | 200 - ProjectFeature::ENABLED | nil | 404 - ProjectFeature::PRIVATE | "admin" | 200 - ProjectFeature::PRIVATE | "owner" | 200 - ProjectFeature::PRIVATE | "master" | 200 - ProjectFeature::PRIVATE | "developer" | 200 - ProjectFeature::PRIVATE | "reporter" | 200 - ProjectFeature::PRIVATE | "guest" | 200 - ProjectFeature::PRIVATE | "user" | 403 - ProjectFeature::PRIVATE | nil | 404 + where(:pages_access_level, :with_user, :admin_mode, :expected_result) do + ProjectFeature::DISABLED | "admin" | true | 403 + ProjectFeature::DISABLED | "owner" | false | 403 + ProjectFeature::DISABLED | "master" | false | 403 + ProjectFeature::DISABLED | "developer" | false | 403 + ProjectFeature::DISABLED | "reporter" | false | 403 + ProjectFeature::DISABLED | "guest" | false | 403 + ProjectFeature::DISABLED | "user" | false | 403 + ProjectFeature::DISABLED | nil | false | 404 + ProjectFeature::PUBLIC | "admin" | false | 200 + ProjectFeature::PUBLIC | "owner" | false | 200 + ProjectFeature::PUBLIC | "master" | false | 200 + ProjectFeature::PUBLIC | "developer" | false | 200 + ProjectFeature::PUBLIC | "reporter" | false | 200 + ProjectFeature::PUBLIC | "guest" | false | 200 + ProjectFeature::PUBLIC | "user" | false | 200 + ProjectFeature::PUBLIC | nil | false | 404 + ProjectFeature::ENABLED | "admin" | false | 200 + ProjectFeature::ENABLED | "owner" | false | 200 + ProjectFeature::ENABLED | "master" | false | 200 + ProjectFeature::ENABLED | "developer" | false | 200 + ProjectFeature::ENABLED | "reporter" | false | 200 + ProjectFeature::ENABLED | "guest" | false | 200 + ProjectFeature::ENABLED | "user" | false | 200 + ProjectFeature::ENABLED | nil | false | 404 + ProjectFeature::PRIVATE | "admin" | true | 200 + ProjectFeature::PRIVATE | "owner" | false | 200 + ProjectFeature::PRIVATE | "master" | false | 200 + ProjectFeature::PRIVATE | "developer" | false | 200 + ProjectFeature::PRIVATE | "reporter" | false | 200 + ProjectFeature::PRIVATE | "guest" | false | 200 + ProjectFeature::PRIVATE | "user" | false | 403 + ProjectFeature::PRIVATE | nil | false | 404 end with_them do @@ -77,7 +77,7 @@ RSpec.describe "Internal Project Pages Access", feature_category: :pages do it "correct return value" do if !with_user.nil? user = public_send(with_user) - get api("/projects/#{project.id}/pages_access", user) + get api("/projects/#{project.id}/pages_access", user, admin_mode: admin_mode) else get api("/projects/#{project.id}/pages_access") end diff --git a/spec/requests/api/pages/pages_spec.rb b/spec/requests/api/pages/pages_spec.rb index c426f2a433c..0f6675799ad 100644 --- a/spec/requests/api/pages/pages_spec.rb +++ b/spec/requests/api/pages/pages_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe API::Pages, feature_category: :pages do - let_it_be(:project) { create(:project, path: 'my.project', pages_https_only: false) } + let_it_be_with_reload(:project) { create(:project, path: 'my.project', pages_https_only: false) } let_it_be(:admin) { create(:admin) } let_it_be(:user) { create(:user) } @@ -19,7 +19,7 @@ RSpec.describe API::Pages, feature_category: :pages do end it_behaves_like '404 response' do - let(:request) { delete api("/projects/#{project.id}/pages", admin) } + let(:request) { delete api("/projects/#{project.id}/pages", admin, admin_mode: true) } end end @@ -30,13 +30,13 @@ RSpec.describe API::Pages, feature_category: :pages do context 'when Pages are deployed' do it 'returns 204' do - delete api("/projects/#{project.id}/pages", admin) + delete api("/projects/#{project.id}/pages", admin, admin_mode: true) expect(response).to have_gitlab_http_status(:no_content) end it 'removes the pages' do - delete api("/projects/#{project.id}/pages", admin) + delete api("/projects/#{project.id}/pages", admin, admin_mode: true) expect(project.reload.pages_metadatum.deployed?).to be(false) end @@ -48,7 +48,7 @@ RSpec.describe API::Pages, feature_category: :pages do end it 'returns 204' do - delete api("/projects/#{project.id}/pages", admin) + delete api("/projects/#{project.id}/pages", admin, admin_mode: true) expect(response).to have_gitlab_http_status(:no_content) end @@ -58,7 +58,7 @@ RSpec.describe API::Pages, feature_category: :pages do it 'returns 404' do id = -1 - delete api("/projects/#{id}/pages", admin) + delete api("/projects/#{id}/pages", admin, admin_mode: true) expect(response).to have_gitlab_http_status(:not_found) end diff --git a/spec/requests/api/pages/private_access_spec.rb b/spec/requests/api/pages/private_access_spec.rb index 5cc1b8f9a69..602eff73b0a 100644 --- a/spec/requests/api/pages/private_access_spec.rb +++ b/spec/requests/api/pages/private_access_spec.rb @@ -35,39 +35,39 @@ RSpec.describe "Private Project Pages Access", feature_category: :pages do describe "GET /projects/:id/pages_access" do context 'access depends on the level' do - where(:pages_access_level, :with_user, :expected_result) do - ProjectFeature::DISABLED | "admin" | 403 - ProjectFeature::DISABLED | "owner" | 403 - ProjectFeature::DISABLED | "master" | 403 - ProjectFeature::DISABLED | "developer" | 403 - ProjectFeature::DISABLED | "reporter" | 403 - ProjectFeature::DISABLED | "guest" | 403 - ProjectFeature::DISABLED | "user" | 404 - ProjectFeature::DISABLED | nil | 404 - ProjectFeature::PUBLIC | "admin" | 200 - ProjectFeature::PUBLIC | "owner" | 200 - ProjectFeature::PUBLIC | "master" | 200 - ProjectFeature::PUBLIC | "developer" | 200 - ProjectFeature::PUBLIC | "reporter" | 200 - ProjectFeature::PUBLIC | "guest" | 200 - ProjectFeature::PUBLIC | "user" | 404 - ProjectFeature::PUBLIC | nil | 404 - ProjectFeature::ENABLED | "admin" | 200 - ProjectFeature::ENABLED | "owner" | 200 - ProjectFeature::ENABLED | "master" | 200 - ProjectFeature::ENABLED | "developer" | 200 - ProjectFeature::ENABLED | "reporter" | 200 - ProjectFeature::ENABLED | "guest" | 200 - ProjectFeature::ENABLED | "user" | 404 - ProjectFeature::ENABLED | nil | 404 - ProjectFeature::PRIVATE | "admin" | 200 - ProjectFeature::PRIVATE | "owner" | 200 - ProjectFeature::PRIVATE | "master" | 200 - ProjectFeature::PRIVATE | "developer" | 200 - ProjectFeature::PRIVATE | "reporter" | 200 - ProjectFeature::PRIVATE | "guest" | 200 - ProjectFeature::PRIVATE | "user" | 404 - ProjectFeature::PRIVATE | nil | 404 + where(:pages_access_level, :with_user, :admin_mode, :expected_result) do + ProjectFeature::DISABLED | "admin" | true | 403 + ProjectFeature::DISABLED | "owner" | false | 403 + ProjectFeature::DISABLED | "master" | false | 403 + ProjectFeature::DISABLED | "developer" | false | 403 + ProjectFeature::DISABLED | "reporter" | false | 403 + ProjectFeature::DISABLED | "guest" | false | 403 + ProjectFeature::DISABLED | "user" | false | 404 + ProjectFeature::DISABLED | nil | false | 404 + ProjectFeature::PUBLIC | "admin" | true | 200 + ProjectFeature::PUBLIC | "owner" | false | 200 + ProjectFeature::PUBLIC | "master" | false | 200 + ProjectFeature::PUBLIC | "developer" | false | 200 + ProjectFeature::PUBLIC | "reporter" | false | 200 + ProjectFeature::PUBLIC | "guest" | false | 200 + ProjectFeature::PUBLIC | "user" | false | 404 + ProjectFeature::PUBLIC | nil | false | 404 + ProjectFeature::ENABLED | "admin" | true | 200 + ProjectFeature::ENABLED | "owner" | false | 200 + ProjectFeature::ENABLED | "master" | false | 200 + ProjectFeature::ENABLED | "developer" | false | 200 + ProjectFeature::ENABLED | "reporter" | false | 200 + ProjectFeature::ENABLED | "guest" | false | 200 + ProjectFeature::ENABLED | "user" | false | 404 + ProjectFeature::ENABLED | nil | false | 404 + ProjectFeature::PRIVATE | "admin" | true | 200 + ProjectFeature::PRIVATE | "owner" | false | 200 + ProjectFeature::PRIVATE | "master" | false | 200 + ProjectFeature::PRIVATE | "developer" | false | 200 + ProjectFeature::PRIVATE | "reporter" | false | 200 + ProjectFeature::PRIVATE | "guest" | false | 200 + ProjectFeature::PRIVATE | "user" | false | 404 + ProjectFeature::PRIVATE | nil | false | 404 end with_them do @@ -77,7 +77,7 @@ RSpec.describe "Private Project Pages Access", feature_category: :pages do it "correct return value" do if !with_user.nil? user = public_send(with_user) - get api("/projects/#{project.id}/pages_access", user) + get api("/projects/#{project.id}/pages_access", user, admin_mode: admin_mode) else get api("/projects/#{project.id}/pages_access") end diff --git a/spec/requests/api/pages/public_access_spec.rb b/spec/requests/api/pages/public_access_spec.rb index 1137f91f4b0..8b0ed7c59ab 100644 --- a/spec/requests/api/pages/public_access_spec.rb +++ b/spec/requests/api/pages/public_access_spec.rb @@ -35,39 +35,39 @@ RSpec.describe "Public Project Pages Access", feature_category: :pages do describe "GET /projects/:id/pages_access" do context 'access depends on the level' do - where(:pages_access_level, :with_user, :expected_result) do - ProjectFeature::DISABLED | "admin" | 403 - ProjectFeature::DISABLED | "owner" | 403 - ProjectFeature::DISABLED | "master" | 403 - ProjectFeature::DISABLED | "developer" | 403 - ProjectFeature::DISABLED | "reporter" | 403 - ProjectFeature::DISABLED | "guest" | 403 - ProjectFeature::DISABLED | "user" | 403 - ProjectFeature::DISABLED | nil | 403 - ProjectFeature::PUBLIC | "admin" | 200 - ProjectFeature::PUBLIC | "owner" | 200 - ProjectFeature::PUBLIC | "master" | 200 - ProjectFeature::PUBLIC | "developer" | 200 - ProjectFeature::PUBLIC | "reporter" | 200 - ProjectFeature::PUBLIC | "guest" | 200 - ProjectFeature::PUBLIC | "user" | 200 - ProjectFeature::PUBLIC | nil | 200 - ProjectFeature::ENABLED | "admin" | 200 - ProjectFeature::ENABLED | "owner" | 200 - ProjectFeature::ENABLED | "master" | 200 - ProjectFeature::ENABLED | "developer" | 200 - ProjectFeature::ENABLED | "reporter" | 200 - ProjectFeature::ENABLED | "guest" | 200 - ProjectFeature::ENABLED | "user" | 200 - ProjectFeature::ENABLED | nil | 200 - ProjectFeature::PRIVATE | "admin" | 200 - ProjectFeature::PRIVATE | "owner" | 200 - ProjectFeature::PRIVATE | "master" | 200 - ProjectFeature::PRIVATE | "developer" | 200 - ProjectFeature::PRIVATE | "reporter" | 200 - ProjectFeature::PRIVATE | "guest" | 200 - ProjectFeature::PRIVATE | "user" | 403 - ProjectFeature::PRIVATE | nil | 403 + where(:pages_access_level, :with_user, :admin_mode, :expected_result) do + ProjectFeature::DISABLED | "admin" | false | 403 + ProjectFeature::DISABLED | "owner" | false | 403 + ProjectFeature::DISABLED | "master" | false | 403 + ProjectFeature::DISABLED | "developer" | false | 403 + ProjectFeature::DISABLED | "reporter" | false | 403 + ProjectFeature::DISABLED | "guest" | false | 403 + ProjectFeature::DISABLED | "user" | false | 403 + ProjectFeature::DISABLED | nil | false | 403 + ProjectFeature::PUBLIC | "admin" | false | 200 + ProjectFeature::PUBLIC | "owner" | false | 200 + ProjectFeature::PUBLIC | "master" | false | 200 + ProjectFeature::PUBLIC | "developer" | false | 200 + ProjectFeature::PUBLIC | "reporter" | false | 200 + ProjectFeature::PUBLIC | "guest" | false | 200 + ProjectFeature::PUBLIC | "user" | false | 200 + ProjectFeature::PUBLIC | nil | false | 200 + ProjectFeature::ENABLED | "admin" | false | 200 + ProjectFeature::ENABLED | "owner" | false | 200 + ProjectFeature::ENABLED | "master" | false | 200 + ProjectFeature::ENABLED | "developer" | false | 200 + ProjectFeature::ENABLED | "reporter" | false | 200 + ProjectFeature::ENABLED | "guest" | false | 200 + ProjectFeature::ENABLED | "user" | false | 200 + ProjectFeature::ENABLED | nil | false | 200 + ProjectFeature::PRIVATE | "admin" | true | 200 + ProjectFeature::PRIVATE | "owner" | false | 200 + ProjectFeature::PRIVATE | "master" | false | 200 + ProjectFeature::PRIVATE | "developer" | false | 200 + ProjectFeature::PRIVATE | "reporter" | false | 200 + ProjectFeature::PRIVATE | "guest" | false | 200 + ProjectFeature::PRIVATE | "user" | false | 403 + ProjectFeature::PRIVATE | nil | false | 403 end with_them do @@ -77,7 +77,7 @@ RSpec.describe "Public Project Pages Access", feature_category: :pages do it "correct return value" do if !with_user.nil? user = public_send(with_user) - get api("/projects/#{project.id}/pages_access", user) + get api("/projects/#{project.id}/pages_access", user, admin_mode: admin_mode) else get api("/projects/#{project.id}/pages_access") end diff --git a/spec/requests/api/pages_domains_spec.rb b/spec/requests/api/pages_domains_spec.rb index ba1fb5105b8..ea83fa384af 100644 --- a/spec/requests/api/pages_domains_spec.rb +++ b/spec/requests/api/pages_domains_spec.rb @@ -41,14 +41,14 @@ RSpec.describe API::PagesDomains, feature_category: :pages do end it_behaves_like '404 response' do - let(:request) { get api('/pages/domains', admin) } + let(:request) { get api('/pages/domains', admin, admin_mode: true) } end end context 'when pages is enabled' do context 'when authenticated as an admin' do - it 'returns paginated all pages domains' do - get api('/pages/domains', admin) + it 'returns paginated all pages domains', :aggregate_failures do + get api('/pages/domains', admin, admin_mode: true) expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('public_api/v4/pages_domain_basics') @@ -74,7 +74,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do describe 'GET /projects/:project_id/pages/domains' do shared_examples_for 'get pages domains' do - it 'returns paginated pages domains' do + it 'returns paginated pages domains', :aggregate_failures do get api(route, user) expect(response).to have_gitlab_http_status(:ok) @@ -145,7 +145,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do describe 'GET /projects/:project_id/pages/domains/:domain' do shared_examples_for 'get pages domain' do - it 'returns pages domain' do + it 'returns pages domain', :aggregate_failures do get api(route_domain, user) expect(response).to have_gitlab_http_status(:ok) @@ -155,7 +155,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(json_response['certificate']).to be_nil end - it 'returns pages domain with project path' do + it 'returns pages domain with project path', :aggregate_failures do get api(route_domain_path, user) expect(response).to have_gitlab_http_status(:ok) @@ -165,7 +165,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(json_response['certificate']).to be_nil end - it 'returns pages domain with a certificate' do + it 'returns pages domain with a certificate', :aggregate_failures do get api(route_secure_domain, user) expect(response).to have_gitlab_http_status(:ok) @@ -177,7 +177,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(json_response['auto_ssl_enabled']).to be false end - it 'returns pages domain with an expired certificate' do + it 'returns pages domain with an expired certificate', :aggregate_failures do get api(route_expired_domain, user) expect(response).to have_gitlab_http_status(:ok) @@ -185,7 +185,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(json_response['certificate']['expired']).to be true end - it 'returns pages domain with letsencrypt' do + it 'returns pages domain with letsencrypt', :aggregate_failures do get api(route_letsencrypt_domain, user) expect(response).to have_gitlab_http_status(:ok) @@ -258,7 +258,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do let(:params_secure) { pages_domain_secure_params.slice(:domain, :certificate, :key) } shared_examples_for 'post pages domains' do - it 'creates a new pages domain' do + it 'creates a new pages domain', :aggregate_failures do expect { post api(route, user), params: params } .to publish_event(PagesDomains::PagesDomainCreatedEvent) .with( @@ -279,7 +279,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(pages_domain.auto_ssl_enabled).to be false end - it 'creates a new secure pages domain' do + it 'creates a new secure pages domain', :aggregate_failures do post api(route, user), params: params_secure pages_domain = PagesDomain.find_by(domain: json_response['domain']) @@ -291,7 +291,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(pages_domain.auto_ssl_enabled).to be false end - it 'creates domain with letsencrypt enabled' do + it 'creates domain with letsencrypt enabled', :aggregate_failures do post api(route, user), params: pages_domain_with_letsencrypt_params pages_domain = PagesDomain.find_by(domain: json_response['domain']) @@ -301,7 +301,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(pages_domain.auto_ssl_enabled).to be true end - it 'creates domain with letsencrypt enabled and provided certificate' do + it 'creates domain with letsencrypt enabled and provided certificate', :aggregate_failures do post api(route, user), params: params_secure.merge(auto_ssl_enabled: true) pages_domain = PagesDomain.find_by(domain: json_response['domain']) @@ -376,7 +376,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do let(:params_secure_nokey) { pages_domain_secure_params.slice(:certificate) } shared_examples_for 'put pages domain' do - it 'updates pages domain removing certificate' do + it 'updates pages domain removing certificate', :aggregate_failures do put api(route_secure_domain, user), params: { certificate: nil, key: nil } pages_domain_secure.reload @@ -399,7 +399,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do ) end - it 'updates pages domain adding certificate' do + it 'updates pages domain adding certificate', :aggregate_failures do put api(route_domain, user), params: params_secure pages_domain.reload @@ -409,7 +409,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(pages_domain.key).to eq(params_secure[:key]) end - it 'updates pages domain adding certificate with letsencrypt' do + it 'updates pages domain adding certificate with letsencrypt', :aggregate_failures do put api(route_domain, user), params: params_secure.merge(auto_ssl_enabled: true) pages_domain.reload @@ -420,7 +420,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(pages_domain.auto_ssl_enabled).to be true end - it 'updates pages domain enabling letsencrypt' do + it 'updates pages domain enabling letsencrypt', :aggregate_failures do put api(route_domain, user), params: { auto_ssl_enabled: true } pages_domain.reload @@ -429,7 +429,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(pages_domain.auto_ssl_enabled).to be true end - it 'updates pages domain disabling letsencrypt while preserving the certificate' do + it 'updates pages domain disabling letsencrypt while preserving the certificate', :aggregate_failures do put api(route_letsencrypt_domain, user), params: { auto_ssl_enabled: false } pages_domain_with_letsencrypt.reload @@ -440,7 +440,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(pages_domain_with_letsencrypt.certificate).to be end - it 'updates pages domain with expired certificate' do + it 'updates pages domain with expired certificate', :aggregate_failures do put api(route_expired_domain, user), params: params_secure pages_domain_expired.reload @@ -450,7 +450,7 @@ RSpec.describe API::PagesDomains, feature_category: :pages do expect(pages_domain_expired.key).to eq(params_secure[:key]) end - it 'updates pages domain with expired certificate not updating key' do + it 'updates pages domain with expired certificate not updating key', :aggregate_failures do put api(route_secure_domain, user), params: params_secure_nokey pages_domain_secure.reload -- cgit v1.2.1