Created
November 13, 2014 16:50
-
-
Save allcentury/3058d20018965d85152e to your computer and use it in GitHub Desktop.
FactoryGirl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it 'user can be invited twice which causes new token generation' do | |
user2 = create(:user, email: "[email protected]") | |
token = user2.invitation_token | |
date = user2.invitation_created_at | |
count = User.count | |
post :create, invitation: { email: '[email protected]', | |
organization_id: @org.org_id, | |
role: 'standard' | |
} | |
user2.reload | |
expect(response).to have_http_status(201) | |
expect(User.count).to eq count | |
expect(User.where(email: user2.email).count).to eq 1 | |
expect(user2.invitation_token).to_not eq token | |
expect(user2.invitation_created_at).to_not eq date | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment