Permalink
Browse files

Merge branch 'master' of github.com:intridea/omniauth

  • Loading branch information...
2 parents b9da8d5 + 2f79618 commit c33890dc67601a7ef14310b5553ab30289e4e327 Michael Bleigh committed Oct 28, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 spec/omniauth/strategy_spec.rb
@@ -546,9 +546,17 @@ def make_env(path = '/auth/test', props = {})
strategy.call(make_env('/auth/test/callback', 'rack.session' => {'omniauth.origin' => 'http://example.com/origin'}))
strategy.env['omniauth.origin'].should == 'http://example.com/origin'
end
+
+ after do
+ OmniAuth.config.test_mode = false
+ end
end
context 'custom full_host' do
+ before do
+ OmniAuth.config.test_mode = true
+ end
+
it 'should be the string when a string is there' do
OmniAuth.config.full_host = 'my.host.com'
strategy.full_host.should == 'my.host.com'
@@ -559,10 +567,18 @@ def make_env(path = '/auth/test', props = {})
strategy.call(make_env('/auth/test', 'HOST' => 'my.host.net'))
strategy.full_host.should == 'my.host.net'
end
+
+ after do
+ OmniAuth.config.test_mode = false
+ end
end
end
context 'setup phase' do
+ before do
+ OmniAuth.config.test_mode = true
+ end
+
context 'when options[:setup] = true' do
let(:strategy){ ExampleStrategy.new(app, :setup => true) }
let(:app){lambda{|env| env['omniauth.strategy'].options[:awesome] = 'sauce' if env['PATH_INFO'] == '/auth/test/setup'; [404, {}, 'Awesome'] }}
@@ -597,5 +613,9 @@ def make_env(path = '/auth/test', props = {})
strategy.options[:awesome].should == 'sauce'
end
end
+
+ after do
+ OmniAuth.config.test_mode = false
+ end
end
end

0 comments on commit c33890d

Please sign in to comment.