I am using subdomains as account keys and some tests failed for controllers, they were looking for the account but didn’t find it.
The trick is to rewrite the host in the tests. Here’s the code for rspec.
before(:each) do
@request.host = 'piku.mysite.net'
end
Here, before each test the url is rewritten and the filter that finds the account happily does it job.
Thx for posting this. Came in handy just now!
Comment by Shanti Braford — September 22, 2008 @ 1:01 am
Thanks for this, I can stop pulling my hair out now!
Comment by Scott Burton — July 31, 2009 @ 5:53 am