DEV: Properly cleanup auth providers in test (#24482)
Followup to 5c38e55dc9
This commit is contained in:
parent
a12f4ebee2
commit
91fe91e03b
|
@ -1125,13 +1125,15 @@ RSpec.describe Users::OmniauthCallbacksController do
|
|||
end
|
||||
end
|
||||
|
||||
let(:fake_auth_provider) { Auth::AuthProvider.new(authenticator: FakeAuthenticator.new) }
|
||||
|
||||
before do
|
||||
DiscoursePluginRegistry.register_auth_provider(
|
||||
Auth::AuthProvider.new(authenticator: FakeAuthenticator.new),
|
||||
)
|
||||
DiscoursePluginRegistry.register_auth_provider(fake_auth_provider)
|
||||
OmniAuth.config.test_mode = false
|
||||
end
|
||||
|
||||
after { DiscoursePluginRegistry.auth_providers.delete(fake_auth_provider) }
|
||||
|
||||
it "does not run 'other_phase' for disabled auth methods" do
|
||||
get "/auth/fake/blah"
|
||||
expect(response.status).to eq(404)
|
||||
|
|
Loading…
Reference in New Issue