Module: Passwordless::TestHelpers::TestCase

Defined in:
lib/passwordless/test_helpers.rb

Instance Method Summary collapse

Instance Method Details

#passwordless_sign_in(resource) ⇒ Object



9
10
11
12
13
# File 'lib/passwordless/test_helpers.rb', line 9

def (resource)
  session = Passwordless::Session.create!(authenticatable: resource, user_agent: "TestAgent", remote_addr: "unknown")
  get Passwordless::Engine.routes.url_helpers.(session.token)
  follow_redirect!
end

#passwordless_sign_outObject



4
5
6
7
# File 'lib/passwordless/test_helpers.rb', line 4

def passwordless_sign_out
  delete Passwordless::Engine.routes.url_helpers.sign_out_path
  follow_redirect!
end