Skip to content
Snippets Groups Projects
Commit 0cebe47b authored by Derek Lindahl's avatar Derek Lindahl
Browse files

Added missing ticket failure test

parent fd0e009e
No related branches found
No related tags found
No related merge requests found
......@@ -21,10 +21,14 @@ module OmniAuth
@configuration = Configuration.new( @options )
end
# def callback_phase
# ap "CALLBACK PHASE"
# super
# end
def callback_phase
ticket = request.params['ticket']
return fail!(:no_ticket, 'No CAS Ticket') unless ticket
# validator = ServiceTicketValidator.new(@configuration, callback_url, ticket)
# @user_info = validator.user_info
return fail!(:invalid_ticket, 'Invalid CAS Ticket') if @user_info.empty?
super
end
# def request_call
# ap "REQUEST CALL"
......
......@@ -29,15 +29,18 @@ describe OmniAuth::Strategies::CAS, :type => :strategy do
end
end
# describe 'GET /auth/cas/callback without a ticket' do
# before do
# # get '/auth/cas/callback'
# end
# it 'should fail'# do
# # last_response.should be_redirect
# # last_response.headers['Location'].should =~ /no_ticket/
# # end
# end
describe 'GET /auth/cas/callback without a ticket' do
before do
get '/auth/cas/callback'
end
subject { last_response }
it { should be_redirect }
it "should have a failure message" do
subject.headers['Location'].should =~ /message=no_ticket/
end
end
# describe 'GET /auth/cas/callback with an invalid ticket' do
# before do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment