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 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 | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//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 |