Do not use trailing underscores in parallel assignment
This commit is contained in:
parent
fc304abe2b
commit
61a6440786
|
@ -34,24 +34,24 @@ describe OmniAuth::FailureEndpoint do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'is a redirect' do
|
it 'is a redirect' do
|
||||||
status, _, _ = *subject.call(env)
|
status, = *subject.call(env)
|
||||||
expect(status).to eq(302)
|
expect(status).to eq(302)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'includes the SCRIPT_NAME' do
|
it 'includes the SCRIPT_NAME' do
|
||||||
_, head, _ = *subject.call(env.merge('SCRIPT_NAME' => '/random'))
|
_, head, = *subject.call(env.merge('SCRIPT_NAME' => '/random'))
|
||||||
expect(head['Location']).to eq('/random/auth/failure?message=invalid_request&strategy=test')
|
expect(head['Location']).to eq('/random/auth/failure?message=invalid_request&strategy=test')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'respects the configured path prefix' do
|
it 'respects the configured path prefix' do
|
||||||
allow(OmniAuth.config).to receive(:path_prefix).and_return('/boo')
|
allow(OmniAuth.config).to receive(:path_prefix).and_return('/boo')
|
||||||
_, head, _ = *subject.call(env)
|
_, head, = *subject.call(env)
|
||||||
expect(head['Location']).to eq('/boo/failure?message=invalid_request&strategy=test')
|
expect(head['Location']).to eq('/boo/failure?message=invalid_request&strategy=test')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'includes the origin (escaped) if one is provided' do
|
it 'includes the origin (escaped) if one is provided' do
|
||||||
env.merge! 'omniauth.origin' => '/origin-example'
|
env.merge! 'omniauth.origin' => '/origin-example'
|
||||||
_, head, _ = *subject.call(env)
|
_, head, = *subject.call(env)
|
||||||
expect(head['Location']).to be_include('&origin=%2Forigin-example')
|
expect(head['Location']).to be_include('&origin=%2Forigin-example')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue