Fix failing test

Test was not waiting for the page to be fully loaded
This commit is contained in:
Alfredo Sumaran 2016-08-17 22:55:24 -05:00
parent 43252ccbee
commit bac19f4c5c
1 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,8 @@
require 'spec_helper'
feature 'Create New Merge Request', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
@ -53,10 +55,11 @@ feature 'Create New Merge Request', feature: true, js: true do
expect(page.find_link('Side-by-side')[:class]).not_to match(/\bactive\b/)
click_link 'Side-by-side'
wait_for_ajax
click_link 'Changes'
expect(page.find_link('Inline')[:class]).not_to match(/\bactive\b/)
expect(page.find_link('Side-by-side')[:class]).to match(/\bactive\b/)
within '.merge-request' do
expect(page).not_to have_css('a.btn.active', text: 'Inline')
expect(page).to have_css('a.btn.active', text: 'Side-by-side')
end
end
end