update tests for /users/:id/resend_verification

This commit is contained in:
Rick Carlino 2017-08-31 14:35:07 -05:00
parent 3cb326be25
commit 2731ee0fa4
2 changed files with 4 additions and 4 deletions

View file

@ -11,7 +11,7 @@ module Users
def execute
UserMailer.welcome_email(user).deliver_later
{message: SENT}
{user: SENT}
end
end
end

View file

@ -125,7 +125,7 @@ describe Api::UsersController do
end
it 'refuses to send token to a user if they are already verified' do
verified = User.create!(email: "foo@bar.com",
verified = User.create!(email: Faker::Internet.email,
password: "password123",
password_confirmation: "password123",
verified_at: Time.now)
@ -137,11 +137,11 @@ describe Api::UsersController do
end
it 'refuses to send token to a user if they are already verified' do
unverified = User.create!(email: "foo@bar.com",
unverified = User.create!(email: Faker::Internet.email,
password: "password123",
password_confirmation: "password123")
post :resend_verification, params: { id: verified.email }
post :resend_verification, params: { id: unverified.email }
expect(response.status).to eq(200)
expect(json[:user]).to include(Users::ResendVerification::SENT)
end