I\'m trying to test a controller and I got this error. I understand the error, but don\'t know how to fix it.
test: on CREATE to :user with completely invali
setup do
@request.env['HTTP_REFERER'] = 'http://test.com/sessions/new'
post :create, { :user => { :email => 'invalid@abc' } }
end
In Rails 2.2.2, the above block never ran actual test. Saying that
post :create, { :user => { :email => 'invalid@abc' } }
line did not run. You can simply get rid of setup block and use
@request.env['HTTP_REFERER'] = 'http://test.com/sessions/new'
post :create, { :user => { :email => 'invalid@abc' } }
instead. And it should set the referer