mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FEATURE: allow staff to send multiple invites to same email
This commit is contained in:
@ -53,6 +53,14 @@ describe InvitesController do
|
||||
response.should_not be_success
|
||||
end
|
||||
|
||||
it "fails for normal user if invite email already exists" do
|
||||
user = log_in(:elder)
|
||||
invite = Invite.invite_by_email("invite@example.com", user)
|
||||
invite.reload
|
||||
post :create, email: invite.email
|
||||
response.should_not be_success
|
||||
end
|
||||
|
||||
it "allows admins to invite to groups" do
|
||||
group = Fabricate(:group)
|
||||
log_in(:admin)
|
||||
@ -60,6 +68,14 @@ describe InvitesController do
|
||||
response.should be_success
|
||||
Invite.find_by(email: email).invited_groups.count.should == 1
|
||||
end
|
||||
|
||||
it "allows admin to send multiple invites to same email" do
|
||||
user = log_in(:admin)
|
||||
invite = Invite.invite_by_email("invite@example.com", user)
|
||||
invite.reload
|
||||
post :create, email: invite.email
|
||||
response.should be_success
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user