require_relative '../test_config' require 'helix_versioning_engine' require 'hws_settings' describe 'HelixVersioningEngine commands' do include Rack::Test::Methods def app HELIX_WEB_SERVICES_APP end context 'GET /helix_versioning_engine/v78/commands/:command' do it 'should return a 403 for commands that are not whitelisted' do authorize 'jdoe', ticket_for_jdoe get('/helix_versioning_engine/v78/commands/sync') expect(last_response.status).to eq(403) end it 'should return a 403 for commands that are missing required args' do authorize 'jdoe', ticket_for_jdoe get('/helix_versioning_engine/v78/commands/files') expect(last_response.status).to eq(403) end it 'should allow you to run a whitelisted command, specified via a string' do authorize 'jdoe', ticket_for_jdoe get('/helix_versioning_engine/v78/commands/info') expect(last_response.status).to eq(200) end it 'should allow you to run a whitelisted command if you specify a ' + 'required argument via an array' do authorize 'jdoe', ticket_for_jdoe get('/helix_versioning_engine/v78/commands/files?arg1=-m&arg2=10&arg3=//depot/.../README') expect(last_response.status).to eq(200) end end context 'POST /helix_versioning_engine/v78/commands/:command' do it 'should return a 403 for commands that are not whitelisted' do authorize 'jdoe', ticket_for_jdoe post('/helix_versioning_engine/v78/commands/sync') expect(last_response.status).to eq(403) end 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/helix_versioning_engine/commands_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/helix_versioning_engine/commands_spec.rb | |||||
#2 | 15240 | tjuricek |
Set api level via request path on all Helix Versioning Engine methods. This will allow migration of applications to different P4D versions. Our internal methods (like project API) should attempt to handle backward compatibility similarly. P4WEBAPI-118 |
||
#1 | 15208 | tjuricek |
Revise 'command' implementation, tests, and documentaiton. This includes a change from a command blacklist to a whitelist. See P4WEBAPI-21 |