diff options
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/notes_on_merge_requests_spec.rb | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb index bf3c12012e5..36394265abf 100644 --- a/spec/features/notes_on_merge_requests_spec.rb +++ b/spec/features/notes_on_merge_requests_spec.rb @@ -19,8 +19,10 @@ describe 'Comments' do it 'should be valid' do should have_css(".js-main-target-form", visible: true, count: 1) find(".js-main-target-form input[type=submit]").value.should == "Add Comment" - within(".js-main-target-form") { should_not have_link("Cancel") } - within('.js-main-target-form') { should have_css('.js-md-preview-button', visible: false) } + within('.js-main-target-form') do + expect(page).not_to have_link('Cancel') + expect(page).not_to have_css('.js-md-preview-button', visible: true) + end end describe "with text" do @@ -31,8 +33,10 @@ describe 'Comments' do end it 'should have enable submit button and preview button' do - within(".js-main-target-form") { should_not have_css(".js-comment-button[disabled]") } - within('.js-main-target-form') { should have_css('.js-md-preview-button', visible: true) } + within(".js-main-target-form") do + expect(page).not_to have_css(".js-comment-button[disabled]") + expect(page).to have_css('.js-md-preview-button') + end end end end @@ -41,15 +45,17 @@ describe 'Comments' do before do within(".js-main-target-form") do fill_in "note[note]", with: "This is awsome!" - find('.js-md-preview-button').trigger('click') + find('.js-md-preview-button').click click_button "Add Comment" end end it 'should be added and form reset' do should have_content("This is awsome!") - within(".js-main-target-form") { should have_no_field("note[note]", with: "This is awesome!") } - within('.js-main-target-form') { should have_css('.js-md-preview', visible: false) } + within(".js-main-target-form") do + expect(page).to have_no_field("note[note]", with: "This is awesome!") + expect(page).not_to have_css('.js-md-preview', visible: true) + end within(".js-main-target-form") { should have_css(".js-note-text", visible: true) } end end @@ -172,11 +178,11 @@ describe 'Comments' do # add two separate texts and trigger previews on both within("tr[id='#{line_code}'] + .js-temp-notes-holder") do fill_in "note[note]", with: "One comment on line 7" - find('.js-md-preview-button').trigger('click') + find('.js-md-preview-button').click end within("tr[id='#{line_code_2}'] + .js-temp-notes-holder") do fill_in "note[note]", with: "Another comment on line 10" - find('.js-md-preview-button').trigger('click') + find('.js-md-preview-button').click end end end |