Adjust specs
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 3s

This commit is contained in:
Râu Cao 2023-06-22 13:57:55 +02:00
parent 93740f17ef
commit e4ed797920
Signed by: raucao
GPG Key ID: 15E65F399D084BA9

View File

@ -26,14 +26,14 @@ RSpec.describe 'Admin/global settings', type: :feature do
expect(current_url).to eq(admin_settings_services_url(params: { s: "discourse" })) expect(current_url).to eq(admin_settings_services_url(params: { s: "discourse" }))
end end
scenario "View ejabberd settings" do scenario "View service settings" do
visit admin_settings_services_path(params: { s: "ejabberd" }) visit admin_settings_services_path(params: { s: "ejabberd" })
expect(page).to have_content("Enable ejabberd integration") expect(page).to have_content("Enable ejabberd integration")
expect(page).to have_field("API URL", with: "http://xmpp.example.com/api") expect(page).to have_field("API URL", with: "http://xmpp.example.com/api")
end end
scenario "Disable ejabberd integration" do scenario "Disable a service integration" do
visit admin_settings_services_path(params: { s: "ejabberd" }) visit admin_settings_services_path(params: { s: "ejabberd" })
expect(page).to have_checked_field("setting[ejabberd_enabled]") expect(page).to have_checked_field("setting[ejabberd_enabled]")
@ -45,27 +45,6 @@ RSpec.describe 'Admin/global settings', type: :feature do
expect(page).to_not have_field("API URL", disabled: true) expect(page).to_not have_field("API URL", disabled: true)
end end
scenario "View remoteStorage settings" do
visit admin_settings_services_path(params: { s: "remotestorage" })
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)
end
scenario "Resettable fields" do scenario "Resettable fields" do
visit admin_settings_services_path(params: { s: "ejabberd" }) visit admin_settings_services_path(params: { s: "ejabberd" })
expect(page).to have_field("API URL", with: "http://xmpp.example.com/api") expect(page).to have_field("API URL", with: "http://xmpp.example.com/api")