require_relative '../test_config' require 'hws_settings' require 'helix_sync' require 'base64' describe 'HelixSync clients' do include Rack::Test::Methods def app HELIX_WEB_SERVICES_APP end my_project_id = HWSStrings.component_encode('My Project') device_client_info = { device: 'test_device', root: '/dev/null' } after(:each) do HWSSettings.settings_handle.HVE_PROJECTS_PATH = nil end context 'POST /helix-sync/v1/:project/clients/device' do context 'no implementation' do it 'returns a 404' do if Cloud::Settings.cloud_enabled? skip 'cloud does not need the HVE... setting' end authorize 'jdoe', ticket_for_jdoe post("/helix-sync/v1/#{my_project_id}/clients/device", device_client_info) expect(last_response.status).to eq(404) end end context 'HVE projects' do it 'can create a project' do HWSSettings.settings_handle.HVE_PROJECTS_PATH = '//depot/main' authorize 'jdoe', ticket_for_jdoe post("/helix-sync/v1/#{my_project_id}/clients/device", device_client_info) expect(last_response.status).to eq(200) client_data = JSON.parse(last_response.body) expect(client_data['client']).to include(my_project_id) expect(client_data['client']).to include(device_client_info[:device]) expect(client_data['client']).to include('jdoe') end end end context 'POST /helix-sync/v1/:project/clients/shelf' do context 'no implementation' do it 'returns a 404' do if Cloud::Settings.cloud_enabled? skip 'cloud does not need the HVE... setting' end authorize 'jdoe', ticket_for_jdoe post("/helix-sync/v1/#{my_project_id}/clients/shelf") expect(last_response.status).to eq(404) end end context 'HVE projects' do it 'can create a project' do HWSSettings.settings_handle.HVE_PROJECTS_PATH = '//depot/main' authorize 'jdoe', ticket_for_jdoe post("/helix-sync/v1/#{my_project_id}/clients/shelf") expect(last_response.status).to eq(200) end end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 16114 | Doug Scheirer | Merge from main | ||
#4 | 16024 | Doug Scheirer | Some cloud spec forking, got the mock_raymond to spin up in cloud testing, split normal vs cloud spec output | ||
#3 | 15854 | Doug Scheirer |
Cloud auth and projects Still getting 2 extra project errors even thought nothing is configured to be cloud enabled |
||
#2 | 15845 | Doug Scheirer | Integ from main | ||
#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/helix_sync/clients_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_sync/clients_spec.rb | |||||
#2 | 15542 | tjuricek |
Add spaces to our basic 'component encode' mechanism, and use it for HVE project IDs. In general, this will make the HVE IDs a bit more readable. |
||
#1 | 15479 | tjuricek | Added a basic "HVE project" implementation for creating clients. |