Created
September 27, 2012 14:31
-
-
Save mulderp/3794314 to your computer and use it in GitHub Desktop.
API spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'vcr' | |
require 'fakeweb' | |
require 'pry' | |
VCR.configure do |c| | |
c.cassette_library_dir = 'fixtures/vcr_cassettes' | |
c.hook_into :fakeweb | |
end | |
describe OmniAuth::Strategies::OAuthConnect do | |
def app | |
Rack::Builder.new { | |
use Rack::Session::Cookie | |
use OmniAuth::Strategies::OAuthConnect, "handle", "appid", "http://0.0.0.0:3000/oauth2/authorize" | |
run lambda {|env| [404, {'Content-Type' => 'text/plain'}, [nil || env.key?('omniauth.auth').to_s]] } | |
}.to_app | |
end | |
let(:auth_hash) { last_request.env['omniauth.auth'] } | |
describe "#request_phase" do | |
it "should redirect to fidor with session_id" do | |
VCR.use_cassette 'request_phase' do | |
get '/auth/fidor_connect' | |
last_response.should be_redirect | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment