mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
DEV: Properly cleanup auth providers in test (#24482)
Followup to 5c38e55dc9047c121d7727352e994041d26ce95
This commit is contained in:
@ -1125,13 +1125,15 @@ RSpec.describe Users::OmniauthCallbacksController do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
let(:fake_auth_provider) { Auth::AuthProvider.new(authenticator: FakeAuthenticator.new) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
DiscoursePluginRegistry.register_auth_provider(
|
DiscoursePluginRegistry.register_auth_provider(fake_auth_provider)
|
||||||
Auth::AuthProvider.new(authenticator: FakeAuthenticator.new),
|
|
||||||
)
|
|
||||||
OmniAuth.config.test_mode = false
|
OmniAuth.config.test_mode = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
after { DiscoursePluginRegistry.auth_providers.delete(fake_auth_provider) }
|
||||||
|
|
||||||
it "does not run 'other_phase' for disabled auth methods" do
|
it "does not run 'other_phase' for disabled auth methods" do
|
||||||
get "/auth/fake/blah"
|
get "/auth/fake/blah"
|
||||||
expect(response.status).to eq(404)
|
expect(response.status).to eq(404)
|
||||||
|
Reference in New Issue
Block a user