Allow editing and resetting of all admin setting strings
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Râu Cao
2023-06-22 13:48:29 +02:00
parent affb058671
commit 93740f17ef
14 changed files with 137 additions and 71 deletions

View File

@@ -30,9 +30,7 @@ RSpec.describe 'Admin/global settings', type: :feature do
visit admin_settings_services_path(params: { s: "ejabberd" })
expect(page).to have_content("Enable ejabberd integration")
expect(page).to have_field("API URL",
with: "http://xmpp.example.com/api",
disabled: true)
expect(page).to have_field("API URL", with: "http://xmpp.example.com/api")
end
scenario "Disable ejabberd integration" do
@@ -67,5 +65,16 @@ RSpec.describe 'Admin/global settings', type: :feature do
expect(page).to_not have_checked_field("setting[remotestorage_enabled]")
expect(page).to_not have_field("Storage URL", disabled: true)
end
scenario "Resettable fields" do
visit admin_settings_services_path(params: { s: "ejabberd" })
expect(page).to have_field("API URL", with: "http://xmpp.example.com/api")
expect(page).to_not have_css('input#setting_ejabberd_api_url+button')
Setting.ejabberd_api_url = "http://example.com/foo"
visit admin_settings_services_path(params: { s: "ejabberd" })
expect(page).to have_field("API URL", with: "http://example.com/foo")
expect(page).to have_css('input#setting_ejabberd_api_url+button')
end
end
end