summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/features
diff options
context:
space:
mode:
authorVitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com>2017-10-05 09:31:34 +1100
committerVitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com>2017-10-05 09:31:34 +1100
commit2fc45e4d7e7f476ed67d9e9b61e6c1c6820e7c00 (patch)
tree4b1072d08238311171e1d6dc3234a8472f0514cb /spec/support/shared_examples/features
parent664cd27faa6082d3b67e39aec7931cb6a7579031 (diff)
downloadgitlab-ce-2fc45e4d7e7f476ed67d9e9b61e6c1c6820e7c00.tar.gz
Replace the 'project/merge_requests.feature' spinach test with an rspec analogreplace_project_merge_requests.feature
Diffstat (limited to 'spec/support/shared_examples/features')
-rw-r--r--spec/support/shared_examples/features/comments_on_merge_request_files_shared_examples.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/support/shared_examples/features/comments_on_merge_request_files_shared_examples.rb b/spec/support/shared_examples/features/comments_on_merge_request_files_shared_examples.rb
new file mode 100644
index 00000000000..221926aaf7e
--- /dev/null
+++ b/spec/support/shared_examples/features/comments_on_merge_request_files_shared_examples.rb
@@ -0,0 +1,28 @@
+shared_examples 'comment on merge request file' do
+ it 'adds a comment' do
+ click_diff_line(find("[id='#{sample_commit.line_code}']"))
+
+ page.within('.js-discussion-note-form') do
+ fill_in(:note_note, with: 'Line is wrong')
+ click_button('Comment')
+ end
+
+ wait_for_requests
+
+ page.within('.notes_holder') do
+ expect(page).to have_content('Line is wrong')
+ end
+
+ visit(merge_request_path(merge_request))
+
+ page.within('.notes .discussion') do
+ expect(page).to have_content("#{user.name} #{user.to_reference} started a discussion")
+ expect(page).to have_content(sample_commit.line_code_path)
+ expect(page).to have_content('Line is wrong')
+ end
+
+ page.within('.notes-tab .badge') do
+ expect(page).to have_content('1')
+ end
+ end
+end