Module: Draper::DeviseHelper
- Included in:
- TestCase::Behavior
- Defined in:
- lib/draper/test/devise_helper.rb
Instance Method Summary collapse
Instance Method Details
#sign_in(resource_or_scope, resource = nil) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/draper/test/devise_helper.rb', line 3 def sign_in(resource_or_scope, resource = nil) scope = begin Devise::Mapping.find_scope!(resource_or_scope) rescue RuntimeError => e # Draper 1.0 didn't require the mapping to exist ActiveSupport::Deprecation.warn("#{e.}.\nUse `sign_in :user, mock_user` instead.", caller) :user end _stub_current_scope scope, resource || resource_or_scope end |
#sign_out(resource_or_scope) ⇒ Object
15 16 17 18 |
# File 'lib/draper/test/devise_helper.rb', line 15 def sign_out(resource_or_scope) scope = Devise::Mapping.find_scope!(resource_or_scope) _stub_current_scope scope, nil end |