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