diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb')
-rw-r--r-- | spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb index 6fc648954b4..12682905559 100644 --- a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb @@ -8,10 +8,14 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j let(:merge_request) { create(:merge_request, source_project: project) } let!(:discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion } - def resolve_all_discussions_link_selector - text = "Resolve all threads in new issue" + def resolve_all_discussions_link_selector(title: "") url = new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) - %Q{a[title="#{text}"][href="#{url}"]} + + if title.empty? + %Q{a[href="#{url}"]} + else + %Q{a[title="#{title}"][href="#{url}"]} + end end describe 'as a user with access to the project' do @@ -23,7 +27,7 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j it 'shows a button to resolve all threads by creating a new issue' do within('.line-resolve-all-container') do - expect(page).to have_selector resolve_all_discussions_link_selector + expect(page).to have_selector resolve_all_discussions_link_selector( title: "Resolve all threads in new issue" ) end end @@ -34,6 +38,7 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j it 'hides the link for creating a new issue' do expect(page).not_to have_selector resolve_all_discussions_link_selector + expect(page).not_to have_content "Resolve all threads in new issue" end end @@ -57,7 +62,7 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j end it 'does not show a link to create a new issue' do - expect(page).not_to have_link 'Create an issue to resolve them later' + expect(page).not_to have_link 'Resolve all threads in new issue' end end @@ -67,18 +72,20 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j end it 'shows a warning that the merge request contains unresolved threads' do - expect(page).to have_content 'There are unresolved threads.' + expect(page).to have_content 'Before this can be merged,' end it 'has a link to resolve all threads by creating an issue' do page.within '.mr-widget-body' do - expect(page).to have_link 'Create an issue to resolve them later', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) + expect(page).to have_link 'Resolve all threads in new issue', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) end end context 'creating an issue for threads' do before do - page.click_link 'Create an issue to resolve them later', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) + page.within '.mr-widget-body' do + page.click_link 'Resolve all threads in new issue', href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) + end end it_behaves_like 'creating an issue for a thread' |