def check_failed_read_of _related_item_conten t_for usertype item_id p

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
def check_failed_read_of_related_item_content_for usertype, item_id, path
log_message "Check failed permissions to read related items for #{usertype.to_s.upcase}"
related_item_response = send_related_content_request_as_usertype_for_item usertype, item_id, path
assert_true related_item_response[:result][:status] == "Failure", "User was able to retrieve info about related items, though he was not supposed to"
if item_id == @@unpublished_test_item_id
error_message = UnpublishedItemMessage % @@unpublished_test_item_id
elsif item_id == @@prohibited_test_item_id
error_message = ProhibitedItemMessage
end
assert_true (related_item_response[:result][:message].include? error_message), "Unexpected error occured. \n Expected error: #{error_message}"
end
def check_failed_read_of_related_items_via_all_services_for usertype, item_id
ClipSharedRelatedItemPath.each do |path|
check_failed_read_of_related_item_content_for usertype, item_id, path
end
endrr