docbrown/spec/system/authentication/creator_config_edit_spec.rb
Michael Kohl 5406b0576e
Split Settings::Authentication from SiteConfig (#13095)
* Split Settings::Authentication from SiteConfig

* Move specs

* Sort fields

* Update settings usages

* Update recaptcha usages

* Add data update script

* Update spec

* Rename SiteConfigParams concern

* Fixes, new route, new controller

* Controller and service refactoring

* More controller and service updates

* Spec updates

* More spec fixes

* Move file

* Fix FeedbackMessagesController

* Update admin/configs_spec

* Fix remaining specs in admin/configs_spec

* Fix configs API

* Formatting

* Clean up old service object

* Various fixes

* Update DUS

* Add model argument to admin_config_label

* Fix key name

* Fix specs

* Add distinct request caches for settings classes

* Fix e2e tests

* Fix remaining system spec

* Make DUS idempotent

* Move routes block

* Cleanup

* Switch to ActiveSupport::CurrentAttributes

* Pinned rails-settings-cached

* Update e2e test

* Update lib/data_update_scripts/20210316091354_move_authentication_settings.rb

Co-authored-by: rhymes <rhymes@hey.com>

* Add guard to DUS

* Temporarily re-add two SiteConfig fields

* Fix config show view

Co-authored-by: rhymes <rhymes@hey.com>
2021-04-12 09:41:09 +02:00

28 lines
848 B
Ruby

require "rails_helper"
RSpec.describe "Creator config edit", type: :system, js: true do
let(:admin) { create(:user, :super_admin) }
# Apple auth is in Beta so we need to enable the Feature Flag to test it
before { Flipper.enable(:apple_auth) }
context "when a creator browses /admin/config" do
before do
sign_in admin
allow(Settings::Authentication).to receive(:invite_only_mode).and_return(false)
end
it "presents all available OAuth providers" do
visit "/admin/config"
within("div[data-target='#authenticationBodyContainer']") do
click_on("Show info", match: :first)
end
Authentication::Providers.available.each do |provider|
element = find(".config-authentication__item--label", text: /#{provider}/i)
expect(element).not_to be_nil
end
end
end
end