diff options
Diffstat (limited to 'spec/features/merge_request/user_posts_diff_notes_spec.rb')
-rw-r--r-- | spec/features/merge_request/user_posts_diff_notes_spec.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/features/merge_request/user_posts_diff_notes_spec.rb b/spec/features/merge_request/user_posts_diff_notes_spec.rb index 19edce1b562..abae6ffbd71 100644 --- a/spec/features/merge_request/user_posts_diff_notes_spec.rb +++ b/spec/features/merge_request/user_posts_diff_notes_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_helper' describe 'Merge request > User posts diff notes', :js do @@ -66,12 +68,12 @@ describe 'Merge request > User posts diff notes', :js do context 'with a match line' do it 'does not allow commenting on the left side' do line_holder = find('.match', match: :first).find(:xpath, '..') - should_not_allow_commenting(line_holder, 'left') + match_should_not_allow_commenting(line_holder) end it 'does not allow commenting on the right side' do line_holder = find('.match', match: :first).find(:xpath, '..') - should_not_allow_commenting(line_holder, 'right') + match_should_not_allow_commenting(line_holder) end end @@ -134,7 +136,7 @@ describe 'Merge request > User posts diff notes', :js do context 'with a match line' do it 'does not allow commenting' do - should_not_allow_commenting(find('.match', match: :first)) + match_should_not_allow_commenting(find('.match', match: :first)) end end @@ -220,7 +222,7 @@ describe 'Merge request > User posts diff notes', :js do context 'with a match line' do it 'does not allow commenting' do - should_not_allow_commenting(find('.match', match: :first)) + match_should_not_allow_commenting(find('.match', match: :first)) end end end @@ -249,6 +251,10 @@ describe 'Merge request > User posts diff notes', :js do expect(line[:num]).not_to have_css comment_button_class end + def match_should_not_allow_commenting(line_holder) + expect(line_holder).not_to have_css comment_button_class + end + def write_comment_on_line(line_holder, diff_side) click_diff_line(line_holder, diff_side) |