In Rails 3.2.9 I have custom error pages defines like this:
# application.rb
config.exceptions_app = self.routes
# routes.rb
match \'/404\' => \'errors#n
the config.consider_all_requests_local = false setting would need to be set in config/environments/test.rb in the same way you have done for your development one.
If you don't want to do this for all tests, perhaps an rspec around filter would be useful to set the state before the test and restore afterwards like so:
# /spec/features/not_found_spec.rb
require 'spec_helper'
describe 'not found page' do
around :each do |example|
Rails.application.config.consider_all_requests_local = false
example.run
Rails.application.config.consider_all_requests_local = true
end
it 'should respond with 404 page' do
visit '/foo'
page.should have_content('not found')
end
end