Last active
August 29, 2015 14:11
-
-
Save naw/dfd6b6b1f0d8956efee7 to your computer and use it in GitHub Desktop.
Capybara save_and_open_page after AJAX, before failed expectation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def original | |
click_link "Load something" # Runs AJAX | |
expect(page).to have_content('Something') | |
end | |
def bad | |
click_link "Load something" # Runs AJAX | |
save_and_open_page # to see why it isn't loading | |
expect(page).to have_content('Something') | |
end | |
def good | |
click_link "Load something" # Runs AJAX | |
begin | |
expect(page).to have_content('Something') | |
rescue Exception | |
save_and_open_page # to see whether it is loading anything at all | |
raise | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment