mirror of
https://github.com/discourse/discourse.git
synced 2026-08-13 14:35:08 -05:00
FIX: Ensure correct locale is set during RenderEmpty responses
Follow-up to bcb0e623
This commit is contained in:
@@ -687,8 +687,9 @@ RSpec.describe ApplicationController do
|
||||
end
|
||||
|
||||
context "with a logged in user" do
|
||||
let(:user) { Fabricate(:user, locale: :fr) }
|
||||
|
||||
before do
|
||||
user = Fabricate(:user, locale: :fr)
|
||||
sign_in(user)
|
||||
end
|
||||
|
||||
@@ -704,6 +705,12 @@ RSpec.describe ApplicationController do
|
||||
expected_title = I18n.t("page_not_found.title", locale: :fr)
|
||||
expect(response.body).to include(CGI.escapeHTML(expected_title))
|
||||
end
|
||||
|
||||
it "serves a RenderEmpty page in the preferred locale" do
|
||||
get "/u/#{user.username}/preferences/interface"
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.body).to have_tag('script', with: { src: "/assets/locales/fr.js" })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user