assert_match(/ v: is too long \(maximum is 255 characters\) /, @response.body)
end
- def test_show
- # check that a visible node is returned properly
- get api_node_path(create(:node))
- assert_response :success
+ def test_show_not_found
+ get api_node_path(0)
+ assert_response :not_found
+ end
- # check that an deleted node is not returned
+ def test_show_deleted
get api_node_path(create(:node, :deleted))
assert_response :gone
+ end
- # check chat a non-existent node is not returned
- get api_node_path(0)
- assert_response :not_found
+ def test_show
+ node = create(:node, :timestamp => "2021-02-03T00:00:00Z")
+
+ get api_node_path(node)
+
+ assert_response :success
+ assert_not_nil @response.header["Last-Modified"]
+ assert_equal "2021-02-03T00:00:00Z", Time.parse(@response.header["Last-Modified"]).utc.xmlschema
end
# Ensure the lat/lon is formatted as a decimal e.g. not 4.0e-05