Skip to content

Instantly share code, notes, and snippets.

@therealadam
Created January 20, 2009 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save therealadam/49274 to your computer and use it in GitHub Desktop.
Save therealadam/49274 to your computer and use it in GitHub Desktop.
not_found do
'Bonk'
end
error(ActiveRecord::RecordNotFound) do
status(404)
'Aside not found'
end
it 'allows changing the response status from the error handler' do
mock_app {
not_found do
'I know exactly what that is!'
end
error FooNotFound do
status(404)
'I have no idea what that is'
end
get '/' do
raise FooNotFound
end
}
get '/'
assert_equal 404, status
assert_equal 'I have no idea what that is', body
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment