From bdb4945dcf3c899c6a88fd42657a1b3f04baced1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 7 Dec 2015 23:08:22 +0100 Subject: Fix random failing test - delete attachment Make sure we wait for AJAX request to finish before end test and cleanup database Signed-off-by: Dmitriy Zaporozhets --- spec/features/notes_on_merge_requests_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'spec/features/notes_on_merge_requests_spec.rb') diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb index d7cb3b2e86e..f0fc6916c4d 100644 --- a/spec/features/notes_on_merge_requests_spec.rb +++ b/spec/features/notes_on_merge_requests_spec.rb @@ -2,6 +2,7 @@ require 'spec_helper' describe 'Comments', feature: true do include RepoHelpers + include WaitForAjax describe 'On a merge request', js: true, feature: true do let!(:merge_request) { create(:merge_request) } @@ -123,8 +124,8 @@ describe 'Comments', feature: true do it 'removes the attachment div and resets the edit form' do find('.js-note-attachment-delete').click is_expected.not_to have_css('.note-attachment') - expect(find('.current-note-edit-form', visible: false)). - not_to be_visible + is_expected.not_to have_css('.current-note-edit-form') + wait_for_ajax end end end -- cgit v1.2.1