Module: Sorcery::TestHelpers::Internal::Rails
- Includes:
- Rails
- Defined in:
- lib/sorcery/test_helpers/internal/rails.rb
Constant Summary
collapse
- SUBMODUELS_AUTO_ADDED_CONTROLLER_FILTERS =
[
:register_last_activity_time_to_db,
:deny_banned_user,
:validate_session
]
Instance Method Summary
collapse
Methods included from Rails
#login_user, #logout_user
Instance Method Details
#clear_user_without_logout ⇒ Object
This helper is used to fake multiple users signing in in tests. It does so by clearing @current_user, thus allowing a new user to login, all this without calling the :logout action explicitly. A dirty dirty hack.
51
52
53
|
# File 'lib/sorcery/test_helpers/internal/rails.rb', line 51
def clear_user_without_logout
subject.instance_variable_set(:@current_user,nil)
end
|
#sorcery_controller_external_property_set(provider, property, value) ⇒ Object
43
44
45
|
# File 'lib/sorcery/test_helpers/internal/rails.rb', line 43
def sorcery_controller_external_property_set(provider, property, value)
::Sorcery::Controller::Config.send(provider).send(:"#{property}=", value)
end
|
#sorcery_controller_property_set(property, value) ⇒ Object
39
40
41
|
# File 'lib/sorcery/test_helpers/internal/rails.rb', line 39
def sorcery_controller_property_set(property, value)
::Sorcery::Controller::Config.send(:"#{property}=", value)
end
|
#sorcery_reload!(submodules = [], options = {}) ⇒ Object