3 class Arvados::V1::KeepDisksControllerTest < ActionController::TestCase
5 test "should get index with ping_secret" do
8 assert_response :success
9 assert_not_nil assigns(:objects)
10 items = JSON.parse(@response.body)['items']
11 assert_not_equal 0, items.size
12 assert_not_nil items[0]['ping_secret']
15 # inactive user does not see any keep disks
16 test "inactive user should get empty index" do
17 authorize_with :inactive
19 assert_response :success
20 items = JSON.parse(@response.body)['items']
21 assert_equal 0, items.size
24 # active user sees non-secret attributes of keep disks
25 test "active user should get non-empty index with no ping_secret" do
26 authorize_with :active
28 assert_response :success
29 items = JSON.parse(@response.body)['items']
30 assert_not_equal 0, items.size
32 assert_nil item['ping_secret']
33 assert_not_nil item['is_readable']
34 assert_not_nil item['is_writable']
35 assert_not_nil item['service_host']
36 assert_not_nil item['service_port']