refactored the api
This commit is contained in:
parent
78c30b847e
commit
4a925d192f
2 changed files with 5 additions and 5 deletions
|
|
@ -126,7 +126,7 @@ describe InvitationsController do
|
|||
@controller.stub!(:current_user).and_return(@user)
|
||||
request.env["HTTP_REFERER"]= 'http://test.host/cats/foo'
|
||||
|
||||
@invited_user = @user.invite_user("a@a.com", @aspect.id)
|
||||
@invited_user = @user.invite_user(@aspect.id, 'email', "a@a.com", "")
|
||||
end
|
||||
|
||||
it 'calls resend invitation if one exists' do
|
||||
|
|
@ -139,7 +139,7 @@ describe InvitationsController do
|
|||
it 'does not send an invitation for a different user' do
|
||||
@user2 = bob
|
||||
@aspect2 = @user2.aspects.create(:name => "cats")
|
||||
@user2.invite_user("b@b.com", @aspect2.id)
|
||||
@user2.invite_user(@aspect2.id, 'email', "b@b.com", "")
|
||||
invitation2 = @user2.reload.invitations_from_me.first
|
||||
Resque.should_not_receive(:enqueue)
|
||||
put :resend, :id => invitation2.id
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ describe Job::ResendInvitation do
|
|||
it 'should call .resend on the object' do
|
||||
user = alice
|
||||
aspect = user.aspects.create(:name => "cats")
|
||||
user.invite_user("b@b.com", aspect.id)
|
||||
user.invite_user(aspect.id, 'email', "a@a.com", "")
|
||||
invitation = user.reload.invitations_from_me.first
|
||||
|
||||
#Notification.should_receive(:notify).with(instance_of(User), instance_of(StatusMessage), instance_of(Person))
|
||||
Invitation.stub(:where).with(:id => invitation.id ).and_return(invitation)
|
||||
Invitation.stub(:where).with(:id => invitation.id ).and_return([invitation])
|
||||
invitation.should_receive(:resend)
|
||||
Job::ResendInvitation.perform_delegate(invitation)
|
||||
Job::ResendInvitation.perform_delegate(invitation.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue