spec/omniauth/strategies/cas_spec.rb in omniauth-cas-0.0.5 vs spec/omniauth/strategies/cas_spec.rb in omniauth-cas-0.0.6.alpha
- old
+ new
@@ -54,11 +54,11 @@
end
end
describe 'GET /auth/cas/callback with an invalid ticket' do
before do
- stub_request(:get, /^https:\/\/cas.example.org(:443)?\/serviceValidate\?([^&]+&)?ticket=9391d/).
+ stub_request(:get, /^https:\/\/cas.example.org(:443)?(:80)?\/serviceValidate\?([^&]+&)?ticket=9391d/).
to_return( :body => File.read('spec/fixtures/cas_failure.xml') )
get '/auth/cas/callback?ticket=9391d'
end
subject { last_response }
@@ -70,11 +70,11 @@
end
describe 'GET /auth/cas/callback with a valid ticket' do
let(:return_url) { "http://127.0.0.10/?some=parameter" }
before do
- stub_request(:get, /^https:\/\/cas.example.org(:443)?\/serviceValidate\?([^&]+&)?ticket=593af/).
+ stub_request(:get, /^https:\/\/cas.example.org(:443)?(:80)?\/serviceValidate\?([^&]+&)?ticket=593af/).
with { |request| @request_uri = request.uri.to_s }.
to_return( :body => File.read('spec/fixtures/cas_success.xml') )
get "/auth/cas/callback?ticket=593af&url=#{return_url}"
end
@@ -82,10 +82,10 @@
it 'should strip the ticket parameter from the callback URL' do
@request_uri.scan('ticket=').length.should == 1
end
it "should properly encode the service URL" do
- WebMock.should have_requested(:get, "https://cas.example.org/serviceValidate")
+ WebMock.should have_requested(:get, "https://cas.example.org:80/serviceValidate")
.with(:query => {
:ticket => "593af",
:service => "http://example.org/auth/cas/callback?url=" + Rack::Utils.escape("http://127.0.0.10/?some=parameter")
})
end
\ No newline at end of file