FIX: inviting a user again after the first invite expires will create a new invite

This commit is contained in:
Neil Lalonde
2014-01-21 15:13:55 -05:00
parent e2c361f353
commit 1dbc1c56b4
5 changed files with 27 additions and 2 deletions

View File

@@ -100,6 +100,15 @@ describe Invite do
it 'matches case sensitively for the local part' do
topic.invite_by_email(inviter, 'ICEKING@adventuretime.ooo').should_not == @invite
end
it 'returns a new invite if the other has expired' do
SiteSetting.stubs(:invite_expiry_days).returns(1)
@invite.created_at = 2.days.ago
@invite.save
new_invite = topic.invite_by_email(inviter, 'iceking@adventuretime.ooo')
new_invite.should_not == @invite
new_invite.should_not be_expired
end
end
context 'when adding to another topic' do