I think this is more correct, admins/mods should always be able to invite
This commit is contained in:
@@ -190,9 +190,14 @@ describe Guardian do
|
||||
Guardian.new(user).can_invite_to?(topic).should be_false
|
||||
end
|
||||
|
||||
it 'returns false when the site requires approving users' do
|
||||
it 'returns true when the site requires approving users and is mod' do
|
||||
SiteSetting.expects(:must_approve_users?).returns(true)
|
||||
Guardian.new(moderator).can_invite_to?(topic).should be_false
|
||||
Guardian.new(moderator).can_invite_to?(topic).should be_true
|
||||
end
|
||||
|
||||
it 'returns true when the site requires approving users and is regular' do
|
||||
SiteSetting.expects(:must_approve_users?).returns(true)
|
||||
Guardian.new(coding_horror).can_invite_to?(topic).should be_false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user