From 2fa473e24ed6a9c455b42a04bc628272dabcb13b Mon Sep 17 00:00:00 2001 From: Awesome Code Date: Sat, 16 Mar 2019 13:40:09 +0000 Subject: [PATCH] Auto corrected by following Lint Ruby EmptyLine --- app/helpers/switch_user_helper.rb | 1 + lib/switch_user/rspec/feature_helpers.rb | 1 + spec/provider/devise_spec.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/app/helpers/switch_user_helper.rb b/app/helpers/switch_user_helper.rb index 6ce8dc5..cbd209e 100644 --- a/app/helpers/switch_user_helper.rb +++ b/app/helpers/switch_user_helper.rb @@ -15,6 +15,7 @@ def switch_user_select(options = {}) next unless selected_user.nil? next if record.is_a?(SwitchUser::GuestRecord) + if provider.current_user?(record.user, record.scope) selected_user = record.scope_id end diff --git a/lib/switch_user/rspec/feature_helpers.rb b/lib/switch_user/rspec/feature_helpers.rb index 06e9f08..e44f75d 100644 --- a/lib/switch_user/rspec/feature_helpers.rb +++ b/lib/switch_user/rspec/feature_helpers.rb @@ -26,6 +26,7 @@ def switch_user(user_record_or_scope, user_id = nil) if identifier.nil? raise SwitchUser::InvalidScope, "don't allow switch this user, please check config.available_users_identifiers" end + user_record_or_scope.send identifier else user_id diff --git a/spec/provider/devise_spec.rb b/spec/provider/devise_spec.rb index d392591..fffc882 100644 --- a/spec/provider/devise_spec.rb +++ b/spec/provider/devise_spec.rb @@ -8,6 +8,7 @@ class FakeWardenSessionSerializer def store(user, scope) return unless user + user_hash[scope] = user end end