user = User.find(user.id) # get the user back
assert_equal(user.first_name, 'first_name_for_newly_created_user')
user = User.find(user.id) # get the user back
assert_equal(user.first_name, 'first_name_for_newly_created_user')
Thread.current[:user] = @active_user # set active user as current user
@active_user.first_name = "first_name_changed"
@active_user.save
Thread.current[:user] = @active_user # set active user as current user
@active_user.first_name = "first_name_changed"
@active_user.save
@active_user = User.find(@active_user.id) # get the user back
assert_equal(@active_user.first_name, 'first_name_changed_by_admin_for_active_user')
end
@active_user = User.find(@active_user.id) # get the user back
assert_equal(@active_user.first_name, 'first_name_changed_by_admin_for_active_user')
end
verify_user resp_user, email
oid_login_perm = find_obj_in_resp response, 'Link', 'arvados#user'
verify_user resp_user, email
oid_login_perm = find_obj_in_resp response, 'Link', 'arvados#user'
verify_link oid_login_perm, 'permission', 'can_login', resp_user[:email],
resp_user[:uuid]
verify_link oid_login_perm, 'permission', 'can_login', resp_user[:email],
resp_user[:uuid]
assert_equal openid_prefix, oid_login_perm[:properties][:identity_url_prefix],
'expected identity_url_prefix not found for oid_login_perm'
assert_equal openid_prefix, oid_login_perm[:properties][:identity_url_prefix],
'expected identity_url_prefix not found for oid_login_perm'
verify_link vm_perm, 'permission', 'can_login', resp_user[:uuid], vm.uuid
end
verify_link vm_perm, 'permission', 'can_login', resp_user[:uuid], vm.uuid
end
- response.each { |x|
- if x.class.name == object_type
- if head_kind
- if x.head_kind == head_kind
- return_obj = x
- break
- end
- else
+ response_items.each { |x|
+ if !x
+ next
+ end
+
+ if object_type == 'User'
+ if ArvadosModel::resource_class_for_uuid(x['uuid']) == User
+ return_obj = x
+ break
+ end
+ else # looking for a link
+ if ArvadosModel::resource_class_for_uuid(x['head_uuid']).kind == head_kind
end
def verify_link (link_object, link_class, link_name, tail_uuid, head_uuid)
end
def verify_link (link_object, link_class, link_name, tail_uuid, head_uuid)
- 'expected non-nil uuid for link for #{link_class} #{link_name}'
- assert_equal link_class, link_object[:link_class],
- 'expected link_class not found for #{link_class} #{link_name}'
- assert_equal link_name, link_object[:name],
- 'expected link_name not found for #{link_class} #{link_name}'
- assert_equal tail_uuid, link_object[:tail_uuid],
- 'expected tail_uuid not found for #{link_class} #{link_name}'
+ "expected non-nil uuid for link for #{link_class} #{link_name}"
+ assert_equal link_class, link_object[:link_class],
+ "expected link_class not found for #{link_class} #{link_name}"
+ assert_equal link_name, link_object[:name],
+ "expected link_name not found for #{link_class} #{link_name}"
+ assert_equal tail_uuid, link_object[:tail_uuid],
+ "expected tail_uuid not found for #{link_class} #{link_name}"
- assert_equal head_uuid, link_object[:head_uuid],
- 'expected head_uuid not found for #{link_class} #{link_name}'
+ assert_equal head_uuid, link_object[:head_uuid],
+ "expected head_uuid not found for #{link_class} #{link_name}"