Makes capybara exact. Should fix some randomly-failing specs

This commit is contained in:
kikito
2015-09-02 18:05:43 +02:00
parent c7b44485b3
commit e3cbae4f02
5 changed files with 7 additions and 6 deletions

View File

@@ -29,7 +29,7 @@ feature 'Admin officials' do
expect(page).to have_content @official.email expect(page).to have_content @official.email
fill_in 'user_official_position', with: 'School Teacher' fill_in 'user_official_position', with: 'School Teacher'
select '3', from: 'user_official_level' select '3', from: 'user_official_level', exact: false
click_button 'Update User' click_button 'Update User'
expect(page).to have_content 'Official position saved!' expect(page).to have_content 'Official position saved!'
@@ -52,7 +52,7 @@ feature 'Admin officials' do
click_link @citizen.name click_link @citizen.name
fill_in 'user_official_position', with: 'Hospital manager' fill_in 'user_official_position', with: 'Hospital manager'
select '4', from: 'user_official_level' select '4', from: 'user_official_level', exact: false
click_button 'Update User' click_button 'Update User'
expect(page).to have_content 'Official position saved!' expect(page).to have_content 'Official position saved!'
@@ -75,4 +75,4 @@ feature 'Admin officials' do
expect(page).to_not have_content @citizen.name expect(page).to_not have_content @citizen.name
expect(page).to_not have_content @official.name expect(page).to_not have_content @official.name
end end
end end

View File

@@ -31,7 +31,7 @@ feature 'Comments' do
expect(page).to have_content("1") expect(page).to have_content("1")
expect(page).to have_content("2") expect(page).to have_content("2")
expect(page).to_not have_content("3") expect(page).to_not have_content("3")
click_link "Next" click_link "Next", exact: false
end end
expect(page).to have_css('.comment', count: 2) expect(page).to have_css('.comment', count: 2)

View File

@@ -28,7 +28,7 @@ feature 'Debates' do
expect(page).to have_content("1") expect(page).to have_content("1")
expect(page).to have_content("2") expect(page).to have_content("2")
expect(page).to_not have_content("3") expect(page).to_not have_content("3")
click_link "Next" click_link "Next", exact: false
end end
expect(page).to have_selector('#debates .debate', count: 2) expect(page).to have_selector('#debates .debate', count: 2)

View File

@@ -32,7 +32,7 @@ feature 'Organizations' do
scenario 'Shared links' do scenario 'Shared links' do
visit new_user_registration_path visit new_user_registration_path
expect(page).to have_link "Sign up as an organization" expect(page).to have_link "Sign up as an organization / collective"
visit new_organization_registration_path visit new_organization_registration_path
expect(page).to have_link "Sign up" expect(page).to have_link "Sign up"

View File

@@ -22,5 +22,6 @@ RSpec.configure do |config|
end end
Capybara.javascript_driver = :poltergeist Capybara.javascript_driver = :poltergeist
Capybara.exact = true
OmniAuth.config.test_mode = true OmniAuth.config.test_mode = true