mirror of
https://github.com/discourse/discourse.git
synced 2026-07-29 15:54:48 -05:00
FEATURE: Add keywords support for site_settings search (#24146)
* FEATURE: Add keywords support for site_settings search
This change allows for a new `keywords` field that can be added to site
settings in order to help with searching. Keywords are not visible in
the UI, but site settings matching one of the contained keywords will
appear when searching for that keyword.
Keywords can be added for site settings inside of the
`config/locales/server.en.yml` file under the new `keywords` key.
```
site_settings
example_1: "fancy description"
example_2: "another description"
keywords:
example_1: "capybara"
```
* Add keywords entry for a recently changed site setting and add system specs
* Use page.visit now that we have our own visit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe "Admin Site Setting Search", type: :system do
|
||||
let(:settings_page) { PageObjects::Pages::AdminSettings.new }
|
||||
fab!(:admin) { Fabricate(:admin) }
|
||||
|
||||
before do
|
||||
SiteSetting.title = "Discourse"
|
||||
sign_in(admin)
|
||||
end
|
||||
|
||||
describe "when searching for keywords" do
|
||||
it "finds the associated site setting" do
|
||||
settings_page.visit
|
||||
settings_page.type_in_search("anonymous_posting_min_trust_level")
|
||||
expect(settings_page).to have_search_result("anonymous_posting_allowed_groups")
|
||||
end
|
||||
|
||||
it "can search for previous site setting without underscores" do
|
||||
settings_page.visit
|
||||
settings_page.type_in_search("anonymous posting min")
|
||||
expect(settings_page).to have_search_result("anonymous_posting_allowed_groups")
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user