Merge branch 'master' into feature/rs-oauth

This commit is contained in:
Râu Cao
2023-07-04 16:43:32 +02:00
23 changed files with 296 additions and 158 deletions

View File

@@ -26,16 +26,14 @@ RSpec.describe 'Admin/global settings', type: :feature do
expect(current_url).to eq(admin_settings_services_url(params: { s: "discourse" }))
end
scenario "View ejabberd settings" do
scenario "View service settings" 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
scenario "Disable a service integration" do
visit admin_settings_services_path(params: { s: "ejabberd" })
expect(page).to have_checked_field("setting[ejabberd_enabled]")
@@ -47,25 +45,15 @@ RSpec.describe 'Admin/global settings', type: :feature do
expect(page).to_not have_field("API URL", disabled: true)
end
scenario "View remoteStorage settings" do
visit admin_settings_services_path(params: { s: "remotestorage" })
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')
expect(page).to have_content("Enable RemoteStorage integration")
expect(page).to have_field("Storage URL",
with: "https://storage.kosmos.org",
disabled: true)
end
scenario "Disable remoteStorage integration" do
visit admin_settings_services_path(params: { s: "remotestorage" })
expect(page).to have_checked_field("setting[remotestorage_enabled]")
uncheck "setting[remotestorage_enabled]"
click_button "Save"
expect(current_url).to eq(admin_settings_services_url(params: { s: "remotestorage" }))
expect(page).to_not have_checked_field("setting[remotestorage_enabled]")
expect(page).to_not have_field("Storage URL", disabled: true)
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