2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-03-05 15:27:34 +08:00
discourse/spec/requests/admin/search_controller_spec.rb
Alan Guo Xiang Tan 9025d98eaf
FIX: Default Locale site setting not included in admin search (#34562)
### Before
<img width="1079" height="981" alt="Screenshot 2025-08-27 at 12 20
30 PM"
src="https://github.com/user-attachments/assets/8b38ef86-e602-440f-8d59-321af1677c95"
/>

### After

<img width="1106" height="1059" alt="Screenshot 2025-08-27 at 12 20
01 PM"
src="https://github.com/user-attachments/assets/1f9e3c61-5a17-4067-ad67-2c9a2e1ba382"
/>
2025-08-27 13:03:44 +08:00

20 lines
474 B
Ruby

# frozen_string_literal: true
RSpec.describe Admin::SearchController do
fab!(:admin)
before { sign_in(admin) }
describe "#index" do
it "includes default_locale setting in search results for general searches" do
get "/admin/search/all.json"
expect(response.status).to eq(200)
locale_setting =
response.parsed_body["settings"].find { |s| s["setting"] == "default_locale" }
expect(locale_setting).to be_present
end
end
end