diff options
author | Ashley Dumaine <adumaine@datto.com> | 2017-09-01 18:39:22 -0400 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-09-06 10:07:47 +0100 |
commit | a3f76b76a4b8db85c6fa557a5e801dcea7195735 (patch) | |
tree | 730f99b9e673ed511a41113cd713ed39702c839f /spec | |
parent | 959e6d221d6b11c64d17fc9d4734200806c293ab (diff) | |
download | gitlab-ce-a3f76b76a4b8db85c6fa557a5e801dcea7195735.tar.gz |
change collapse to resolve and comments to discussions
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/merge_requests/resolve_outdated_diff_discussions.rb (renamed from spec/features/merge_requests/collapse_outdated_diff_comments.rb) | 14 | ||||
-rw-r--r-- | spec/requests/api/projects_spec.rb | 28 | ||||
-rw-r--r-- | spec/requests/api/v3/projects_spec.rb | 28 |
3 files changed, 37 insertions, 33 deletions
diff --git a/spec/features/merge_requests/collapse_outdated_diff_comments.rb b/spec/features/merge_requests/resolve_outdated_diff_discussions.rb index baca34026ea..fd9b2c95210 100644 --- a/spec/features/merge_requests/collapse_outdated_diff_comments.rb +++ b/spec/features/merge_requests/resolve_outdated_diff_discussions.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Collapse outdated diff comments', js: true do +feature 'Resolve outdated diff discussions', js: true do let(:merge_request) { create(:merge_request, importing: true) } let(:project) { merge_request.source_project } @@ -23,9 +23,9 @@ feature 'Collapse outdated diff comments', js: true do sign_in(create(:admin)) end - context 'when project.collapse_outdated_diff_comments == true' do + context 'when project.resolve_outdated_diff_discussions == true' do before do - project.update_column(:collapse_outdated_diff_comments, true) + project.update_column(:resolve_outdated_diff_discussions, true) end context 'with unresolved outdated discussions' do @@ -33,6 +33,7 @@ feature 'Collapse outdated diff comments', js: true do visit_merge_request(merge_request) within(".discussion[data-discussion-id='#{outdated_discussion.id}']") do expect(page).to have_css('.discussion-body .hide .js-toggle-content', visible: false) + expect(page).to have_content('Automatically resolved') end end end @@ -42,14 +43,15 @@ feature 'Collapse outdated diff comments', js: true do visit_merge_request(merge_request) within(".discussion[data-discussion-id='#{active_discussion.id}']") do expect(page).to have_css('.discussion-body .hide .js-toggle-content', visible: true) + expect(page).not_to have_content('Automatically resolved') end end end end - context 'when project.collapse_outdated_diff_comments == false' do + context 'when project.resolve_outdated_diff_discussions == false' do before do - project.update_column(:collapse_outdated_diff_comments, false) + project.update_column(:resolve_outdated_diff_discussions, false) end context 'with unresolved outdated discussions' do @@ -57,6 +59,7 @@ feature 'Collapse outdated diff comments', js: true do visit_merge_request(merge_request) within(".discussion[data-discussion-id='#{outdated_discussion.id}']") do expect(page).to have_css('.discussion-body .hide .js-toggle-content', visible: true) + expect(page).not_to have_content('Automatically resolved') end end end @@ -66,6 +69,7 @@ feature 'Collapse outdated diff comments', js: true do visit_merge_request(merge_request) within(".discussion[data-discussion-id='#{active_discussion.id}']") do expect(page).to have_css('.discussion-body .hide .js-toggle-content', visible: true) + expect(page).not_to have_content('Automatically resolved') end end end diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 5e3fdbd468e..1e71634b5db 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -414,7 +414,7 @@ describe API::Projects do jobs_enabled: false, merge_requests_enabled: false, wiki_enabled: false, - collapse_outdated_diff_comments: false, + resolve_outdated_diff_discussions: false, only_allow_merge_if_pipeline_succeeds: false, request_access_enabled: true, only_allow_merge_if_all_discussions_are_resolved: false, @@ -478,16 +478,16 @@ describe API::Projects do expect(json_response['avatar_url']).to eq("http://localhost/uploads/-/system/project/avatar/#{project_id}/banana_sample.gif") end - it 'sets a project as allowing outdated diff comments to collapse regardless of discussion resolution' do - project = attributes_for(:project, { collapse_outdated_diff_comments: false }) + it 'sets a project as allowing outdated diff discussions to automatically resolve' do + project = attributes_for(:project, { resolve_outdated_diff_discussions: false }) post api('/projects', user), project - expect(json_response['collapse_outdated_diff_comments']).to be_falsey + expect(json_response['resolve_outdated_diff_discussions']).to be_falsey end - it 'sets a project as allowing outdated diff comments to collapse if collapse_outdated_diff_comments' do - project = attributes_for(:project, { collapse_outdated_diff_comments: true }) + it 'sets a project as allowing outdated diff discussions to automatically resolve if resolve_outdated_diff_discussions' do + project = attributes_for(:project, { resolve_outdated_diff_discussions: true }) post api('/projects', user), project - expect(json_response['collapse_outdated_diff_comments']).to be_truthy + expect(json_response['resolve_outdated_diff_discussions']).to be_truthy end it 'sets a project as allowing merge even if build fails' do @@ -655,20 +655,20 @@ describe API::Projects do expect(json_response['visibility']).to eq('private') end - it 'sets a project as allowing outdated diff comments to collapse regardless of discussion resolution' do - project = attributes_for(:project, { collapse_outdated_diff_comments: false }) + it 'sets a project as allowing outdated diff discussions to automatically resolve' do + project = attributes_for(:project, { resolve_outdated_diff_discussions: false }) post api("/projects/user/#{user.id}", admin), project - expect(json_response['collapse_outdated_diff_comments']).to be_falsey + expect(json_response['resolve_outdated_diff_discussions']).to be_falsey end - it 'sets a project as allowing outdated diff comments to collapse only if collapse_outdated_diff_comments' do - project = attributes_for(:project, { collapse_outdated_diff_comments: true }) + it 'sets a project as allowing outdated diff discussions to automatically resolve only if resolve_outdated_diff_discussions' do + project = attributes_for(:project, { resolve_outdated_diff_discussions: true }) post api("/projects/user/#{user.id}", admin), project - expect(json_response['collapse_outdated_diff_comments']).to be_truthy + expect(json_response['resolve_outdated_diff_discussions']).to be_truthy end it 'sets a project as allowing merge even if build fails' do @@ -761,7 +761,7 @@ describe API::Projects do expect(json_response['wiki_enabled']).to be_present expect(json_response['jobs_enabled']).to be_present expect(json_response['snippets_enabled']).to be_present - expect(json_response['collapse_outdated_diff_comments']).to eq(project.collapse_outdated_diff_comments) + expect(json_response['resolve_outdated_diff_discussions']).to eq(project.resolve_outdated_diff_discussions) expect(json_response['container_registry_enabled']).to be_present expect(json_response['created_at']).to be_present expect(json_response['last_activity_at']).to be_present diff --git a/spec/requests/api/v3/projects_spec.rb b/spec/requests/api/v3/projects_spec.rb index bbe56c972bd..f8dd5f960e8 100644 --- a/spec/requests/api/v3/projects_spec.rb +++ b/spec/requests/api/v3/projects_spec.rb @@ -394,7 +394,7 @@ describe API::V3::Projects do issues_enabled: false, merge_requests_enabled: false, wiki_enabled: false, - collapse_outdated_diff_comments: false, + resolve_outdated_diff_discussions: false, only_allow_merge_if_build_succeeds: false, request_access_enabled: true, only_allow_merge_if_all_discussions_are_resolved: false @@ -456,16 +456,16 @@ describe API::V3::Projects do expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PRIVATE) end - it 'sets a project as allowing outdated diff comments to collapse regardless of discussion resolution' do - project = attributes_for(:project, { collapse_outdated_diff_comments: false }) + it 'sets a project as allowing outdated diff discussions to automatically resolve' do + project = attributes_for(:project, { resolve_outdated_diff_discussions: false }) post v3_api('/projects', user), project - expect(json_response['collapse_outdated_diff_comments']).to be_falsey + expect(json_response['resolve_outdated_diff_discussions']).to be_falsey end - it 'sets a project as allowing outdated diff comments to collapse if collapse_outdated_diff_comments' do - project = attributes_for(:project, { collapse_outdated_diff_comments: true }) + it 'sets a project as allowing outdated diff discussions to automatically resolve if resolve_outdated_diff_discussions' do + project = attributes_for(:project, { resolve_outdated_diff_discussions: true }) post v3_api('/projects', user), project - expect(json_response['collapse_outdated_diff_comments']).to be_truthy + expect(json_response['resolve_outdated_diff_discussions']).to be_truthy end it 'sets a project as allowing merge even if build fails' do @@ -612,16 +612,16 @@ describe API::V3::Projects do expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PRIVATE) end - it 'sets a project as allowing outdated diff comments to collapse regardless of discussion resolution' do - project = attributes_for(:project, { collapse_outdated_diff_comments: false }) + it 'sets a project as allowing outdated diff discussions to automatically resolve' do + project = attributes_for(:project, { resolve_outdated_diff_discussions: false }) post v3_api("/projects/user/#{user.id}", admin), project - expect(json_response['collapse_outdated_diff_comments']).to be_falsey + expect(json_response['resolve_outdated_diff_discussions']).to be_falsey end - it 'sets a project as allowing outdated diff comments to collapse only if collapse_outdated_diff_comments' do - project = attributes_for(:project, { collapse_outdated_diff_comments: true }) + it 'sets a project as allowing outdated diff discussions to automatically resolve only if resolve_outdated_diff_discussions' do + project = attributes_for(:project, { resolve_outdated_diff_discussions: true }) post v3_api("/projects/user/#{user.id}", admin), project - expect(json_response['collapse_outdated_diff_comments']).to be_truthy + expect(json_response['resolve_outdated_diff_discussions']).to be_truthy end it 'sets a project as allowing merge even if build fails' do @@ -712,7 +712,7 @@ describe API::V3::Projects do expect(json_response['wiki_enabled']).to be_present expect(json_response['builds_enabled']).to be_present expect(json_response['snippets_enabled']).to be_present - expect(json_response['collapse_outdated_diff_comments']).to eq(project.collapse_outdated_diff_comments) + expect(json_response['resolve_outdated_diff_discussions']).to eq(project.resolve_outdated_diff_discussions) expect(json_response['container_registry_enabled']).to be_present expect(json_response['created_at']).to be_present expect(json_response['last_activity_at']).to be_present |