Skip to content
Browse files

Merge pull request #521 from mkdynamic/patch-1

Address jruby spec issue
  • Loading branch information...
2 parents 5c585ee + c86627a commit 2f796187305fde44772af8917401b8ea6771fb6c Michael Bleigh committed Oct 26, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 spec/omniauth/strategy_spec.rb
View
20 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 2f79618

Please sign in to comment.
Something went wrong with that request. Please try again.