0
0
Fork 0

Fix sr locale being selected over sr-Latn (#13693)

* Fix sr locale being selected over sr-Latn

* Update tests
This commit is contained in:
ThibG 2020-05-11 01:09:21 +02:00 committed by GitHub
parent 4b2d9b8a55
commit 4bcef12bad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 16 deletions

View file

@ -16,10 +16,16 @@ describe ApplicationController, type: :controller do
end
shared_examples 'default locale' do
it 'sets available and preferred language' do
request.headers['Accept-Language'] = 'sr-Latn'
get 'success'
expect(response.body).to eq 'sr-Latn'
end
it 'sets available and preferred language' do
request.headers['Accept-Language'] = 'ca-ES, fa'
get 'success'
expect(response.body).to eq 'fa'
expect(response.body).to eq 'ca'
end
it 'sets available and compatible language if none of available languages are preferred' do