3 class Arvados::V1::NodesControllerTest < ActionController::TestCase
5 test "should get index with ping_secret" do
8 assert_response :success
9 assert_not_nil assigns(:objects)
10 node_items = JSON.parse(@response.body)['items']
11 assert_not_equal 0, node_items.size
12 assert_not_nil node_items[0]['info'].andand['ping_secret']
15 # inactive user does not see any nodes
16 test "inactive user should get empty index" do
17 authorize_with :inactive
19 assert_response :success
20 node_items = JSON.parse(@response.body)['items']
21 assert_equal 0, node_items.size
24 # active user sees non-secret attributes of up and recently-up nodes
25 test "active user should get non-empty index with no ping_secret" do
26 authorize_with :active
28 assert_response :success
29 node_items = JSON.parse(@response.body)['items']
30 assert_not_equal 0, node_items.size
31 node_items.each do |node|
32 assert_nil node['info'].andand['ping_secret']