spec/omniauth/multipassword/base_spec.rb in omniauth-multipassword-2.0.1 vs spec/omniauth/multipassword/base_spec.rb in omniauth-multipassword-2.1.0
- old
+ new
@@ -44,10 +44,13 @@
let(:app) do
Rack::Builder.new do
use OmniAuth::Test::PhonySession
use OmniAuth::Strategies::OneTest
+ map '/app-ok' do
+ run ->(env) { [200, {'Content-Type' => 'text/plain'}, ['OK']] }
+ end
run ->(env) { [404, {'Content-Type' => 'text/plain'}, [env.key?('omniauth.auth').to_s]] }
end.to_app
end
it 'shows login FORM' do
@@ -63,8 +66,13 @@
end
it 'authenticates john with correct password' do
post '/auth/onetest/callback', username: 'john', password: 'secret'
expect(last_response.body).to eq 'true'
+ end
+
+ it 'shows app page' do
+ get '/app-ok'
+ expect(last_response.body).to eq 'OK'
end
end
end