require_relative '../test_config' require 'hws_settings' require 'auth' class TestApp < Sinatra::Base use HWSSettings use Auth::Middleware get '/test' do 'ok' end end describe Auth::Middleware do include Rack::Test::Methods def app TestApp end it 'should allow for valid ticket authentication' do if Cloud::Settings.cloud_enabled? # TODO: not sure why but this fails pending 'this will fail in cloud test mode' end authorize 'jdoe', ticket_for_jdoe get '/test' expect(last_response.status).to eq(200) expect(last_response.body).to eq('ok') end it 'should return a 403 for invalid ticket authentication' do authorize 'jdoe', 'invalid' get '/test' expect(last_response.status).to eq(403) end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 16024 | Doug Scheirer | Some cloud spec forking, got the mock_raymond to spin up in cloud testing, split normal vs cloud spec output | ||
#1 | 15688 | Doug Scheirer |
Populate -o //guest/perforce_software/helix-web-services/... //guest/doug_scheirer/helix-web-services/.... |
||
//guest/perforce_software/helix-web-services/main/source/helix_web_services/spec/auth/middleware_spec.rb | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services/spec/auth/middleware_spec.rb | |||||
#1 | 15073 | tjuricek | Update Auth::Middleware and add spec |