Archive for the 'testing' Category

Stubbing the referer method onto TestRequest

« 28 June 2007 | 18:32 | rubyonrails, testing | No Comments »

I have a before_filter that relies on request.referer to set an instance variable (@cancel_link) for use in the views. When trying to test that the instance variable was assigned in my functional tests, I realized that TestRequest doesn’t have the #referer method like CgiRequest does.
fizx on #rubyonrails got me heading in the right direction with […]