From 4bcef12bad8f554f3b0fc2fc34b7d4ca4cc567db Mon Sep 17 00:00:00 2001
From: ThibG <thib@sitedethib.com>
Date: Mon, 11 May 2020 01:09:21 +0200
Subject: Fix sr locale being selected over sr-Latn (#13693)

* Fix sr locale being selected over sr-Latn

* Update tests
---
 spec/controllers/concerns/localized_spec.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'spec/controllers/concerns')

diff --git a/spec/controllers/concerns/localized_spec.rb b/spec/controllers/concerns/localized_spec.rb
index 7635d10e1..a89e24af0 100644
--- a/spec/controllers/concerns/localized_spec.rb
+++ b/spec/controllers/concerns/localized_spec.rb
@@ -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
-- 
cgit