Get request with custom locale in your tests
26 Oct 2015Sometimes in tests you have to set special locale for get
request.
For example you want to test selecting locale language.
For this you have to set locale in 'HTTP_ACCEPT_LANGUAGE'
variable in params hash.
it 'your test description' do
rackenv = {'HTTP_ACCEPT_LANGUAGE' => 'ru,en'}
get '/', {}, rackenv
...
end