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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/features/resolving_discussions_in_issues_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/features/resolving_discussions_in_issues_shared_examples.rb38
1 files changed, 12 insertions, 26 deletions
diff --git a/spec/support/shared_examples/features/resolving_discussions_in_issues_shared_examples.rb b/spec/support/shared_examples/features/resolving_discussions_in_issues_shared_examples.rb
index 6d44a6fde85..337b3f3cbd0 100644
--- a/spec/support/shared_examples/features/resolving_discussions_in_issues_shared_examples.rb
+++ b/spec/support/shared_examples/features/resolving_discussions_in_issues_shared_examples.rb
@@ -1,43 +1,29 @@
# frozen_string_literal: true
RSpec.shared_examples 'creating an issue for a thread' do
- it 'shows an issue with the title filled in' do
+ it 'shows an issue creation form' do
+ # Title field is filled in
title_field = page.find_field('issue[title]')
-
expect(title_field.value).to include(merge_request.title)
- end
- it 'has a mention of the discussion in the description' do
- description_field = page.find_field('issue[description]')
+ # Has a hidden field for the merge request
+ merge_request_field = find('#merge_request_to_resolve_discussions_of', visible: false)
+ expect(merge_request_field.value).to eq(merge_request.iid.to_s)
+ # Has a mention of the discussion in the description
+ description_field = page.find_field('issue[description]')
expect(description_field.value).to include(discussion.first_note.note)
end
- it 'can create a new issue for the project' do
+ it 'creates a new issue for the project' do
+ # Actually creates an issue for the project
expect { click_button 'Create issue' }.to change { project.issues.reload.size }.by(1)
- end
-
- it 'resolves the discussion in the merge request' do
- click_button 'Create issue'
+ # Resolves the discussion in the merge request
discussion.first_note.reload
-
expect(discussion.resolved?).to eq(true)
- end
-
- it 'shows a flash messaage after resolving a discussion' do
- click_button 'Create issue'
-
- page.within '.flash-notice' do
- # Only check for the word 'Resolved' since the spec might have resolved
- # multiple discussions
- expect(page).to have_content('Resolved')
- end
- end
-
- it 'has a hidden field for the merge request' do
- merge_request_field = find('#merge_request_to_resolve_discussions_of', visible: false)
- expect(merge_request_field.value).to eq(merge_request.iid.to_s)
+ # Issue title inludes MR title
+ expect(page).to have_content(%Q(Follow-up from "#{merge_request.title}"))
end
end