2016-12-16 11:21:28 -05:00
|
|
|
module IntegrationHelpers
|
|
|
|
def sign_in(user)
|
|
|
|
password = 'somecomplicatedpassword'
|
|
|
|
user.update!(password: password)
|
|
|
|
Fabricate(:email_token, confirmed: true, user: user)
|
2017-08-09 05:17:54 -04:00
|
|
|
xhr :post, "/session.json", login: user.username, password: password
|
2016-12-16 11:21:28 -05:00
|
|
|
expect(response).to be_success
|
|
|
|
end
|
|
|
|
end
|