FIX: invite link should not auto-accept invitation if user is already logged in

This commit is contained in:
Arpit Jalan
2016-02-23 19:03:12 +05:30
parent ced86aa890
commit 1253afdf95
4 changed files with 27 additions and 0 deletions

View File

@ -218,6 +218,16 @@ describe InvitesController do
end
end
context 'user is already logged in' do
let!(:user) { log_in }
let(:topic) { Fabricate(:topic) }
let(:invite) { topic.invite_by_email(topic.user, "iceking@adventuretime.ooo") }
it "doesn't redeem the invite" do
Invite.any_instance.stubs(:redeem).never
get :show, id: invite.invite_key
end
end
end
context '.create_disposable_invite' do