require 'spec_helper' describe OmniAuth::Strategies::GitLab do attr_accessor :app let(:auth_hash){ last_response.headers['env']['omniauth.auth'] } def set_app!(gitlab_options = {}) old_app = self.app self.app = Rack::Builder.app do use Rack::Session::Cookie use OmniAuth::Strategies::GitLab, {:site => 'http://some.site.com/' }.merge(gitlab_options) run lambda{|env| [404, {'env' => env}, ["HELLO!"]]} end if block_given? yield self.app = old_app end self.app end before(:all) do set_app! end describe '#request_phase' do it 'should display a form' do get '/auth/gitlab' last_response.body.should be_include("