Merge branch '4753-websocket-test-port'
[arvados.git] / services / api / test / integration / keep_proxy_test.rb
1 require 'test_helper'
2
3 class KeepProxyTest < ActionDispatch::IntegrationTest
4   test "request keep disks" do
5     get "/arvados/v1/keep_services/accessible", {:format => :json}, auth(:active)
6     assert_response :success
7     services = json_response['items']
8
9     assert_operator 2, :<=, services.length
10     services.each do |service|
11       assert_equal 'disk', service['service_type']
12     end
13   end
14
15   test "request keep proxy" do
16     get "/arvados/v1/keep_services/accessible", {:format => :json}, auth(:active).merge({'HTTP_X_EXTERNAL_CLIENT' => '1'})
17     assert_response :success
18     services = json_response['items']
19
20     assert_equal 1, services.length
21
22     assert_equal keep_services(:proxy).uuid, services[0]['uuid']
23     assert_equal keep_services(:proxy).service_host, services[0]['service_host']
24     assert_equal keep_services(:proxy).service_port, services[0]['service_port']
25     assert_equal keep_services(:proxy).service_ssl_flag, services[0]['service_ssl_flag']
26     assert_equal 'proxy', services[0]['service_type']
27   end
28 end