require_relative '../test_config' require 'helix_versioning_engine' require 'tempfile' describe 'Config services' do include Rack::Test::Methods def app HELIX_WEB_SERVICES_APP end context 'GET /config/v1/services' do it 'will default to an empty list if the system config file is missing' do file = Tempfile.new('services') HWSSettings.system_handle.SERVICE_CONFIGURATION = file.path file.close file.unlink authorize 'jdoe', ticket_for_jdoe get('/config/v1/services') expect(last_response.status).to eq(200) services = JSON.parse(last_response.body) expect(services).to eq([]) end it 'will return the contents of the SERVICE_CONFIGURATION config file' do example = [ { 'type' => 'p4d', 'uri' => ['p4://perforce.example.com:1678'] } ] file = Tempfile.new('services') file.write(JSON.generate(example)) file.close HWSSettings.system_handle.SERVICE_CONFIGURATION = file.path authorize 'jdoe', ticket_for_jdoe get('/config/v1/services') expect(last_response.status).to eq(200) services = JSON.parse(last_response.body) expect(services).to eq(example) end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#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/config/services_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/config/services_spec.rb | |||||
#1 | 15297 | tjuricek |
Implement of 'cluster services' configuration. The configuration will be stored in a local JSON file, which is expected to be maintained by the systems admin. Eventually, it's expected to have this sort of thing implemented via Helix Admin. |