Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbyMcWho committed Feb 29, 2020
1 parent 6ed88e7 commit d890700
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/omniauth/strategy_spec.rb
Expand Up @@ -242,7 +242,9 @@ def make_env(path = '/auth/test', props = {})
describe '#redirect' do
it 'uses javascript if :iframe is true' do
response = ExampleStrategy.new(app, :iframe => true).redirect('http://abc.com')
expect(response.last.body.first).to be_include('top.location.href')
expected_body = "<script type='text/javascript' charset='utf-8'>top.location.href = 'http://abc.com';</script>"

expect(response.last).to include(expected_body)
end
end

Expand Down Expand Up @@ -653,8 +655,8 @@ def make_env(path = '/auth/test', props = {})
end

it 'maintains host and port' do
response = strategy.call(make_env('/auth/test', 'rack.url_scheme' => 'http', 'HTTP_HOST' => 'example.org', 'SERVER_PORT' => 3000))
expect(response[1]['Location']).to eq('http://example.org:3000/auth/test/callback')
response = strategy.call(make_env('/auth/test', 'rack.url_scheme' => 'http', 'SERVER_NAME' => 'example.org', 'SERVER_PORT' => 9292))
expect(response[1]['Location']).to eq('http://example.org:9292/auth/test/callback')
end

it 'maintains query string parameters' do
Expand Down

0 comments on commit d890700

Please sign in to comment.