3 class Arvados::V1::ContainersControllerTest < ActionController::TestCase
5 authorize_with :system_user
8 command: ['echo', 'hello'],
9 container_image: 'test',
13 assert_response :success
16 [Container::Queued, Container::Complete].each do |state|
17 test "cannot get auth in #{state} state" do
18 authorize_with :dispatch1
19 get :auth, id: containers(:queued).uuid
24 test 'cannot get auth with wrong token' do
25 authorize_with :dispatch1
26 c = containers(:queued)
27 assert c.update_attributes(state: Container::Locked), show_errors(c)
29 authorize_with :system_user
35 authorize_with :dispatch1
36 c = containers(:queued)
37 assert c.update_attributes(state: Container::Locked), show_errors(c)
39 assert_response :success
40 assert_operator 32, :<, json_response['api_token'].length
41 assert_equal 'arvados#apiClientAuthorization', json_response['kind']
44 test 'no auth in container response' do
45 authorize_with :dispatch1
46 c = containers(:queued)
47 assert c.update_attributes(state: Container::Locked), show_errors(c)
49 assert_response :success
50 assert_nil json_response['auth']