mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-11 00:02:05 -05:00
5897d3419c
If I user logged in with Google and then changed email, they would no longer be able to log in with google
19 lines
659 B
Ruby
19 lines
659 B
Ruby
require 'spec_helper'
|
|
|
|
# In the ghetto ... getting the spec to run in autospec
|
|
# thing is we need to load up all auth really early pre-fork
|
|
# it means that the require is not going to get a new copy
|
|
Auth.send(:remove_const, :OpenIdAuthenticator)
|
|
load 'auth/open_id_authenticator.rb'
|
|
|
|
describe Auth::OpenIdAuthenticator do
|
|
|
|
it "can lookup pre-existing user if trusted" do
|
|
auth = Auth::OpenIdAuthenticator.new("test", "id", trusted: true)
|
|
|
|
user = Fabricate(:user)
|
|
response = OpenStruct.new(identity_url: 'abc')
|
|
result = auth.after_authenticate(info: {email: user.email}, extra: {response: response})
|
|
result.user.should == user
|
|
end
|
|
end
|