Merge branch 'master' into feature/donations_btcpay
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2024-03-03 12:50:16 +01:00
13 changed files with 89 additions and 68 deletions

View File

@@ -23,35 +23,35 @@ RSpec.describe 'Admin/global settings', type: :feature do
scenario "Opening service settings shows page for first service" do
visit admin_settings_services_path
expect(current_url).to eq(admin_settings_services_url(params: { s: "btcpay" }))
expect(current_url).to eq(admin_settings_service_url("btcpay"))
end
scenario "View service settings" do
visit admin_settings_services_path(params: { s: "ejabberd" })
visit admin_settings_service_path("ejabberd")
expect(page).to have_content("Enable ejabberd integration")
expect(page).to have_field("API URL", with: "http://xmpp.example.com/api")
end
scenario "Disable a service integration" do
visit admin_settings_services_path(params: { s: "ejabberd" })
visit admin_settings_service_path("ejabberd")
expect(page).to have_checked_field("setting[ejabberd_enabled]")
uncheck "setting[ejabberd_enabled]"
click_button "Save"
expect(current_url).to eq(admin_settings_services_url(params: { s: "ejabberd" }))
expect(current_url).to eq(admin_settings_service_url("ejabberd"))
expect(page).to_not have_checked_field("setting[ejabberd_enabled]")
expect(page).to_not have_field("API URL", disabled: true)
end
scenario "Resettable fields" do
visit admin_settings_services_path(params: { s: "ejabberd" })
visit admin_settings_service_path("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" })
visit admin_settings_service_path("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