Skip to content

Commit

Permalink
Fix Omniauth config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewrudy committed Feb 26, 2017
1 parent 5abdb65 commit 6bc2db4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/omniauth/config_test.rb
Expand Up @@ -25,19 +25,21 @@ class MyStrategy
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
Expand Down

0 comments on commit 6bc2db4

Please sign in to comment.