improve spec
This commit is contained in:
parent
bc0b9af576
commit
27362c5a4b
|
@ -79,18 +79,24 @@ describe DiscourseSingleSignOn do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "unstaged users" do
|
it "unstaged users" do
|
||||||
|
SiteSetting.sso_overrides_name = true
|
||||||
|
|
||||||
email = "staged@user.com"
|
email = "staged@user.com"
|
||||||
Fabricate(:user, staged: true, email: email)
|
Fabricate(:user, staged: true, email: email)
|
||||||
|
|
||||||
sso = DiscourseSingleSignOn.new
|
sso = DiscourseSingleSignOn.new
|
||||||
sso.username = "staged"
|
sso.username = "staged"
|
||||||
sso.name = "Staged User"
|
sso.name = "Bob O'Bob"
|
||||||
sso.email = email
|
sso.email = email
|
||||||
sso.external_id = "B"
|
sso.external_id = "B"
|
||||||
user = sso.lookup_or_create_user(ip_address)
|
user = sso.lookup_or_create_user(ip_address)
|
||||||
|
|
||||||
|
user.reload
|
||||||
|
|
||||||
expect(user).to_not be_nil
|
expect(user).to_not be_nil
|
||||||
expect(user.staged).to be(false)
|
expect(user.staged).to be(false)
|
||||||
|
|
||||||
|
expect(user.name).to eq("Bob O'Bob")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "can set admin and moderator" do
|
it "can set admin and moderator" do
|
||||||
|
|
Loading…
Reference in New Issue