Module: Aker::Test::Helpers
- Defined in:
- lib/aker/test/helpers.rb
Overview
Contains helpers for writing tests on aker-protected code.
Instance Method Summary collapse
-
#login_env(user) ⇒ Hash<String, Aker::Rack::Facade>
Generates an environment hash that marks ‘user` as logged in.
Instance Method Details
#login_env(user) ⇒ Hash<String, Aker::Rack::Facade>
Generates an environment hash that marks ‘user` as logged in. You can use the generated hash in pre-existing requests, merge the hash with the environment generated by `Rack::MockRequest.env_for`, etc.
17 18 19 20 21 |
# File 'lib/aker/test/helpers.rb', line 17 def login_env(user) u = Aker::User === user ? user : Aker..find_user(user) { 'aker.check' => Aker::Rack::Facade.new(Aker.configuration, u) } end |