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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -