Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
renew the test codes
  • Loading branch information
raecoo committed Aug 29, 2011
1 parent 3079ffc commit e8de4f2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions oa-enterprise/oa-enterprise.gemspec
Expand Up @@ -8,6 +8,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'oa-core', OmniAuth::Version::STRING
gem.add_dependency 'pyu-ruby-sasl', '~> 0.0.3.1'
gem.add_dependency 'rubyntlm', '~> 0.1.1'
gem.add_dependency 'uuid'
gem.add_dependency 'XMLCanonicalizer', '~> 1.0.1'
gem.add_development_dependency 'rack-test', '~> 0.5'
gem.add_development_dependency 'rake', '~> 0.8'
Expand Down
37 changes: 37 additions & 0 deletions oa-enterprise/spec/omniauth/strategies/saml_spec.rb
@@ -0,0 +1,37 @@
require File.expand_path('../../../spec_helper', __FILE__)

describe OmniAuth::Strategies::SAML, :type => :strategy do

include OmniAuth::Test::StrategyTestCase

def strategy
[OmniAuth::Strategies::SAML, {
:assertion_consumer_service_url => "http://consumer.service.url/auth/saml/callback",
:issuer => "https://saml.issuer.url/issuers/29490",
:idp_sso_target_url => "https://idp.sso.target_url/signon/29490",
:idp_cert_fingerprint => "E7:91:B2:E1:4C:65:2C:49:F3:33:74:0A:58:5A:7E:55:F7:15:7A:33",
:name_identifier_format => "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
}]
end

describe 'GET /auth/saml' do
before do
get '/auth/saml'
end

it 'should get authentication page' do
last_response.should be_redirect
end
end

describe 'POST /auth/saml/callback' do

it 'should raise ArgumentError exception without the SAMLResponse parameter' do
post '/auth/saml/callback'
last_response.should be_redirect
last_response.location.should == '/auth/failure?message=invalid_ticket'
end

end

end

0 comments on commit e8de4f2

Please sign in to comment.