Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
renew the test codes
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |