mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:21:12 +08:00
FEATURE: Allow sending invites to staged users
This commit is contained in:
@ -1580,4 +1580,24 @@ describe User do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#unstage" do
|
||||
it "correctyl unstages a user" do
|
||||
staged_user = Fabricate(:staged, email: 'staged@account.com', active: true, username: 'staged1', name: 'Stage Name')
|
||||
params = { email: 'staged@account.com', active: true, username: 'unstaged1', name: 'Foo Bar' }
|
||||
user = User.unstage(params)
|
||||
|
||||
expect(user.id).to eq(staged_user.id)
|
||||
expect(user.username).to eq('unstaged1')
|
||||
expect(user.name).to eq('Foo Bar')
|
||||
expect(user.active).to eq(false)
|
||||
expect(user.email).to eq('staged@account.com')
|
||||
end
|
||||
|
||||
it "returns nil when the user cannot be unstaged" do
|
||||
Fabricate(:coding_horror)
|
||||
expect(User.unstage(email: 'jeff@somewhere.com')).to be_nil
|
||||
expect(User.unstage(email: 'no@account.com')).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user