Split api node show test

This commit is contained in:
Anton Khorev 2025-02-01 18:25:32 +03:00
parent cc2677ff24
commit b1dbcad484

View file

@ -193,20 +193,21 @@ module Api
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
# check that an deleted node is not returned
get api_node_path(create(:node, :deleted))
assert_response :gone
# check chat a non-existent node is not returned
def test_show_not_found
get api_node_path(0)
assert_response :not_found
end
def test_show_deleted
get api_node_path(create(:node, :deleted))
assert_response :gone
end
def test_show
get api_node_path(create(:node))
assert_response :success
end
# Ensure the lat/lon is formatted as a decimal e.g. not 4.0e-05
def test_lat_lon_xml_format
node = create(:node, :latitude => (0.00004 * OldNode::SCALE).to_i, :longitude => (0.00008 * OldNode::SCALE).to_i)