diff options
author | Robert Speicher <robert@gitlab.com> | 2015-12-10 22:22:53 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-12-10 22:22:53 +0300 |
commit | 3f4715322e598652b788b55073e41ac095d1ebed (patch) | |
tree | 3b6c616f6095d2fd95dbb35473a53df03f78347f /features | |
parent | b20f677baa94aaea1dbc3437c51abbfd6f0e1548 (diff) | |
parent | 9d6e5f0a28cda3dcbf2dcbcb8a869c0873ea3afc (diff) |
Merge branch 'fix-edit-notes-on-merge-request-diff' into 'master'
Fix editing notes on a merge request diff
Fixes #3910
See merge request !2041
Diffstat (limited to 'features')
-rw-r--r-- | features/project/merge_requests.feature | 10 | ||||
-rw-r--r-- | features/steps/project/merge_requests.rb | 25 |
2 files changed, 35 insertions, 0 deletions
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature index 35ace948888..7490ad400b5 100644 --- a/features/project/merge_requests.feature +++ b/features/project/merge_requests.feature @@ -85,6 +85,16 @@ Feature: Project Merge Requests Then I should see a discussion has started on diff @javascript + Scenario: I edit a comment on a merge request diff + Given project "Shop" have "Bug NS-05" open merge request with diffs inside + And I visit merge request page "Bug NS-05" + And I click on the Changes tab + And I leave a comment like "Line is wrong" on diff + And I change the comment "Line is wrong" to "Typo, please fix" on diff + Then I should not see a diff comment saying "Line is wrong" + And I should see a diff comment saying "Typo, please fix" + + @javascript Scenario: I comment on a line of a commit in merge request Given project "Shop" have "Bug NS-05" open merge request with diffs inside And I visit merge request page "Bug NS-05" diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 0107d9d8486..13d9d180dd1 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -186,6 +186,31 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps leave_comment "Line is wrong" end + step 'I change the comment "Line is wrong" to "Typo, please fix" on diff' do + page.within('.diff-file:nth-of-type(5) .note') do + find('.js-note-edit').click + + page.within('.current-note-edit-form', visible: true) do + fill_in 'note_note', with: 'Typo, please fix' + click_button 'Save Comment' + end + + expect(page).not_to have_button 'Save Comment', disabled: true, visible: true + end + end + + step 'I should not see a diff comment saying "Line is wrong"' do + page.within('.diff-file:nth-of-type(5) .note') do + expect(page).not_to have_visible_content 'Line is wrong' + end + end + + step 'I should see a diff comment saying "Typo, please fix"' do + page.within('.diff-file:nth-of-type(5) .note') do + expect(page).to have_visible_content 'Typo, please fix' + end + end + step 'I should see a discussion has started on diff' do page.within(".notes .discussion") do page.should have_content "#{current_user.name} started a discussion" |