3 class ApplicationControllerTest < ActionController::TestCase
4 BAD_UUID = "zzzzz-zzzzz-zzzzzzzzzzzzzzz"
11 # These tests are meant to check behavior in ApplicationController.
12 # We instantiate a small concrete controller for convenience.
13 @controller = Arvados::V1::SpecimensController.new
14 @start_stamp = now_timestamp
18 token = json_response['error_token']
20 token_time = token.split('+', 2).first.to_i
21 assert_operator(token_time, :>=, @start_stamp, "error token too old")
22 assert_operator(token_time, :<=, now_timestamp, "error token too new")
25 def check_404(errmsg="Path not found")
27 assert_equal([errmsg], json_response['errors'])
31 test "requesting nonexistent object returns 404 error" do
33 get(:show, id: BAD_UUID)
37 test "requesting object without read permission returns 404 error" do
38 authorize_with :spectator
39 get(:show, id: specimens(:owned_by_active_user).uuid)
43 test "submitting bad object returns error" do
44 authorize_with :spectator
45 post(:create, specimen: {badattr: "badvalue"})