Setting http headers RSpec 2.4 / Rails 3 -
i getting started rspec. have new rails 3 app uses http_accept_header or request 2 letter subdomain set application language , redirect accordingly. testing redirection code using cucumber.
now want write controller specs , need set request subdomain before test.
in cucumber steps, can specify:
header 'http_host', 'es.mysite.local' visit '/'
but when try in spec file
header 'http_host', 'es.mysite.local' 'index'
i error:
failure/error: header 'http_host', "es.mysite.local" loaderror: no such file load -- action_controller/integration
any clue on how solve this?
try this:
request.env['http_host'] = 'es.mysite.local' 'index'
Comments
Post a Comment