3 class Arvados::V1::UserAgreementsControllerTest < ActionController::TestCase
5 test "active user get user agreements" do
8 assert_response :success
9 assert_not_nil assigns(:objects)
10 agreements_list = JSON.parse(@response.body)
11 assert_not_nil agreements_list['items']
12 assert_not_nil agreements_list['items'][0]
15 test "active user get user agreement signatures" do
16 authorize_with :active
18 assert_response :success
19 assert_not_nil assigns(:objects)
20 agreements_list = JSON.parse(@response.body)
21 assert_not_nil agreements_list['items']
22 assert_not_nil agreements_list['items'][0]
23 assert_equal 1, agreements_list['items'].count
26 test "inactive user get user agreements" do
27 authorize_with :inactive
29 assert_response :success
30 assert_not_nil assigns(:objects)
31 agreements_list = JSON.parse(@response.body)
32 assert_not_nil agreements_list['items']
33 assert_not_nil agreements_list['items'][0]
36 test "uninvited user receives empty list of user agreements" do
37 authorize_with :inactive_uninvited
39 assert_response :success
40 assert_not_nil assigns(:objects)
41 agreements_list = JSON.parse(@response.body)
42 assert_not_nil agreements_list['items']
43 assert_nil agreements_list['items'][0]