2

I am trying to added a non-english language for a test using capybara and poltergeist. I have tried:

page.driver.headers = { 'HTTP_ACCEPT_LANGUAGE' => 'pt-BR' }

But that is not working. On the server side, 'HTTP_ACCEPT_LANGUAGE' is always 'en-US'. I have even tried adding another arbitrary header but that isn't coming through on the server side. It seems like poltergeist's header setting doesn't seem to work.

4

1 回答 1

2

我预计要设置的正确标头与在 rails 中检索相同,但 HTTP_ACCEPT_LANGUAGE 不是有效的 http 标头(http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html)。它是特定于导轨的。

我需要做:

page.driver.headers = { 'ACCEPT-LANGUAGE' => 'pt-BR' }
于 2013-05-16T00:06:15.320 回答