mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 17:15:32 +08:00
27 lines
731 B
Ruby
27 lines
731 B
Ruby
require 'rails_helper'
|
|
|
|
describe Users::OmniauthCallbacksController do
|
|
|
|
context ".find_authenticator" do
|
|
it "fails if a provider is disabled" do
|
|
SiteSetting.enable_twitter_logins = false
|
|
|
|
expect {
|
|
Users::OmniauthCallbacksController.find_authenticator("twitter")
|
|
}.to raise_error(Discourse::InvalidAccess)
|
|
end
|
|
|
|
it "fails for unknown" do
|
|
expect {
|
|
Users::OmniauthCallbacksController.find_authenticator("twitter1")
|
|
}.to raise_error(Discourse::InvalidAccess)
|
|
end
|
|
|
|
it "finds an authenticator when enabled" do
|
|
SiteSetting.enable_twitter_logins = true
|
|
expect(Users::OmniauthCallbacksController.find_authenticator("twitter")).not_to eq(nil)
|
|
end
|
|
end
|
|
|
|
end
|