Testing Error Pages

9 views
Skip to first unread message

Paul McMahon

unread,
Nov 18, 2011, 2:34:57 AM11/18/11
to Steak
I want to test the custom error pages in my Rails 3.1 app with Steak.
To do that, I make the following changes.

# confing/environments/test.rb
config.consider_all_requests_local = false

# spec/acceptance/acceptance_helper.rb
ActionDispatch::Request.class_eval do
def local? # we need to consider the requests to be non-local to
test error pages
false
end
end

This works, but I'm wondering if there is a better way. Namely
avoiding monkeypatching ActionDispatch::Request.

Reply all
Reply to author
Forward
0 new messages