Merge pull request #1754 from bear454/fix-tests

Fix intermittent failures in track tests
This commit is contained in:
Christian Bruckmayer 2017-10-11 10:57:30 +02:00 committed by GitHub
commit 904ab8d4d5
2 changed files with 17 additions and 4 deletions

View file

@ -36,8 +36,11 @@ feature Track do
expected = expect do expected = expect do
visit admin_conference_program_tracks_path(conference_id: conference.short_title) visit admin_conference_program_tracks_path(conference_id: conference.short_title)
within('#tracks', visible: true) do
click_link 'Delete' page.accept_confirm do
find_link('Delete').click
end
end
end end
expected.to change { Track.count }.by(-1) expected.to change { Track.count }.by(-1)
@ -53,7 +56,9 @@ feature Track do
expected = expect do expected = expect do
visit admin_conference_program_tracks_path(conference_id: conference.short_title) visit admin_conference_program_tracks_path(conference_id: conference.short_title)
click_link 'Edit' within('#tracks', visible: true) do
find_link('Edit').trigger('click')
end
fill_in 'track_name', with: 'Distribution' fill_in 'track_name', with: 'Distribution'
fill_in 'track_short_name', with: 'Distribution' fill_in 'track_short_name', with: 'Distribution'

View file

@ -59,7 +59,7 @@ RSpec.configure do |config|
Capybara.javascript_driver = :poltergeist Capybara.javascript_driver = :poltergeist
Capybara.register_driver :poltergeist do |app| Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, phantomjs: Phantomjs.path, js_errors: false) Capybara::Poltergeist::Driver.new(app, phantomjs: Phantomjs.path, js_errors: false, window_size: [1920, 1080])
end end
# Includes helpers and connect them to specific types of tests # Includes helpers and connect them to specific types of tests
@ -82,6 +82,14 @@ RSpec.configure do |config|
# Types of tests (controller, feature, model) will # Types of tests (controller, feature, model) will
# be inferred from subfolder name # be inferred from subfolder name
config.infer_spec_type_from_file_location! config.infer_spec_type_from_file_location!
# Enable this if you like to see what you're debugging
# config.after(:example) do |example|
# if example.exception
# save_and_open_screenshot
# save_and_open_page
# end
# end
end end
OmniAuth.config.test_mode = true OmniAuth.config.test_mode = true