This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
discourse/spec/controllers/omniauth_callbacks_controller_spec.rb
Sam 213ce33af2 Fixed all broken specs
Moved middleware config into authenticators
2013-08-26 12:59:17 +10:00

25 lines
727 B
Ruby

require 'spec_helper'
describe Users::OmniauthCallbacksController do
context ".find_authenticator" do
it "fails if a provider is disabled" do
SiteSetting.stubs("enable_twitter_logins?").returns(false)
expect(lambda {
Users::OmniauthCallbacksController.find_authenticator("twitter")
}).to raise_error
end
it "fails for unknown" do
expect(lambda {
Users::OmniauthCallbacksController.find_authenticator("twitter1")
}).to raise_error
end
it "finds an authenticator when enabled" do
SiteSetting.stubs("enable_twitter_logins?").returns(true)
expect(Users::OmniauthCallbacksController.find_authenticator("twitter")).not_to eq(nil)
end
end
end