# frozen_string_literal: true require 'spec_helper' describe 'OmniAuth::Strategies::Polaris' do def app Rack::Builder.new do use OmniAuth::Test::PhonySession use OmniAuth::Builder do provider OmniAuth::Strategies::Polaris, name: 'polaris', title: 'MyPolaris Form', http_uri: 'https://blah.org/PAPIService/REST/public/v1/1000/100/1/patron/', access_key: 'F9998888-A000-1111-C22C-CC3333BB4444', access_id: 'API', method: 'POST' end run ->(env) { [404, { 'Content-Type' => 'text/plain' }, [env.key?('omniauth.auth').to_s]] } end.to_app end def session last_request.env['rack.session'] end it 'is expected to add a camelization for itself' do expect(OmniAuth::Utils.camelize('polaris')).to eq('Polaris') end describe '/auth/polaris' do before { post '/auth/polaris' } it 'is expected to display a form' do expect(last_response.status).to be(200) expect(last_response.body).to include('