Remove use of stubs in tests.
This commit is contained in:
parent
76dd6933d2
commit
107d6783a9
|
@ -4,20 +4,21 @@ 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 {
|
||||
SiteSetting.enable_twitter_logins = false
|
||||
|
||||
expect {
|
||||
Users::OmniauthCallbacksController.find_authenticator("twitter")
|
||||
}).to raise_error(Discourse::InvalidAccess)
|
||||
}.to raise_error(Discourse::InvalidAccess)
|
||||
end
|
||||
|
||||
it "fails for unknown" do
|
||||
expect(lambda {
|
||||
expect {
|
||||
Users::OmniauthCallbacksController.find_authenticator("twitter1")
|
||||
}).to raise_error(Discourse::InvalidAccess)
|
||||
}.to raise_error(Discourse::InvalidAccess)
|
||||
end
|
||||
|
||||
it "finds an authenticator when enabled" do
|
||||
SiteSetting.stubs("enable_twitter_logins?").returns(true)
|
||||
SiteSetting.enable_twitter_logins = true
|
||||
expect(Users::OmniauthCallbacksController.find_authenticator("twitter")).not_to eq(nil)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue