diff --git a/test/controllers/helpers_test.rb b/test/controllers/helpers_test.rb index 0de1e19c..acbfe404 100644 --- a/test/controllers/helpers_test.rb +++ b/test/controllers/helpers_test.rb @@ -164,8 +164,8 @@ class ControllerAuthenticatableTest < Devise::ControllerTestCase @controller.instance_variable_set(:@current_user, user) @controller.instance_variable_set(:@current_admin, user) @controller.sign_out - assert_equal nil, @controller.instance_variable_get(:@current_user) - assert_equal nil, @controller.instance_variable_get(:@current_admin) + assert_nil @controller.instance_variable_get(:@current_user) + assert_nil @controller.instance_variable_get(:@current_admin) end test 'sign out logs out and clears up any signed in user by scope' do @@ -175,7 +175,7 @@ class ControllerAuthenticatableTest < Devise::ControllerTestCase @mock_warden.expects(:clear_strategies_cache!).with(scope: :user).returns(true) @controller.instance_variable_set(:@current_user, user) @controller.sign_out(:user) - assert_equal nil, @controller.instance_variable_get(:@current_user) + assert_nil @controller.instance_variable_get(:@current_user) end test 'sign out accepts a resource as argument' do diff --git a/test/omniauth/config_test.rb b/test/omniauth/config_test.rb index 86e96634..d2d0223d 100644 --- a/test/omniauth/config_test.rb +++ b/test/omniauth/config_test.rb @@ -25,19 +25,21 @@ class OmniAuthConfigTest < ActiveSupport::TestCase assert_equal OmniAuth::Strategies::Facebook, config.strategy_class end - test "finds the strategy in OmniAuth's list by name" do - NamedTestStrategy = Class.new - NamedTestStrategy.send :include, OmniAuth::Strategy - NamedTestStrategy.option :name, :the_one + class NamedTestStrategy + include OmniAuth::Strategy + option :name, :the_one + end + test "finds the strategy in OmniAuth's list by name" do config = Devise::OmniAuth::Config.new :the_one, [{}] assert_equal NamedTestStrategy, config.strategy_class end - test "finds the strategy in OmniAuth's list by class name" do - UnNamedTestStrategy = Class.new - UnNamedTestStrategy.send :include, OmniAuth::Strategy + class UnNamedTestStrategy + include OmniAuth::Strategy + end + test "finds the strategy in OmniAuth's list by class name" do config = Devise::OmniAuth::Config.new :un_named_test_strategy, [{}] assert_equal UnNamedTestStrategy, config.strategy_class end