discourse/spec/support/integration_helpers.rb

10 lines
299 B
Ruby

module IntegrationHelpers
def sign_in(user)
password = 'somecomplicatedpassword'
user.update!(password: password)
Fabricate(:email_token, confirmed: true, user: user)
xhr :post, "/session.json", login: user.username, password: password
expect(response).to be_success
end
end