lib/sorcery/test_helpers/internal/rails.rb in sorcery-0.12.0 vs lib/sorcery/test_helpers/internal/rails.rb in sorcery-0.13.0
- old
+ new
@@ -2,15 +2,15 @@
module TestHelpers
module Internal
module Rails
include ::Sorcery::TestHelpers::Rails::Controller
- SUBMODULES_AUTO_ADDED_CONTROLLER_FILTERS = [
- :register_last_activity_time_to_db,
- :deny_banned_user,
- :validate_session
- ]
+ SUBMODULES_AUTO_ADDED_CONTROLLER_FILTERS = %i[
+ register_last_activity_time_to_db
+ deny_banned_user
+ validate_session
+ ].freeze
def sorcery_reload!(submodules = [], options = {})
reload_user_class
# return to no-module configuration
@@ -38,15 +38,15 @@
options.each do |property, value|
user.send(:"#{property}=", value)
end
end
User.authenticates_with_sorcery!
- if defined?(DataMapper) && User.ancestors.include?(DataMapper::Resource)
- DataMapper.auto_migrate!
- User.finalize
- Authentication.finalize
- end
+ return unless defined?(DataMapper) && User.ancestors.include?(DataMapper::Resource)
+
+ DataMapper.auto_migrate!
+ User.finalize
+ Authentication.finalize
end
def sorcery_controller_property_set(property, value)
::Sorcery::Controller::Config.send(:"#{property}=", value)
end
@@ -62,10 +62,10 @@
def clear_user_without_logout
subject.instance_variable_set(:@current_user, nil)
end
if ::Rails.version < '5.0.0'
- %w(get post put).each do |method|
+ %w[get post put].each do |method|
define_method(method) do |action, options = {}|
super action, options[:params] || {}, options[:session]
end
end
end