Skip to content

Instantly share code, notes, and snippets.

@richmolj
Created July 2, 2013 19:16
Show Gist options
  • Save richmolj/5912220 to your computer and use it in GitHub Desktop.
Save richmolj/5912220 to your computer and use it in GitHub Desktop.
pseudo code
context "when the service is down" do
before do
SomeService.stub(:get).and_raise(BadResponseError)
end
it "should show a friendly error message" do
visit '/some-url'
click_link 'Tab 2'
page.find("#loading_indicator").should_not_be_visible
within ".error-container" do
find('.message').should have_text("We're sorry, an error occurred")
end
page.save_screenshot("screenshot.png")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment