A few more edge cases
This commit is contained in:
parent
35be112092
commit
23f568cf3a
3 changed files with 81 additions and 4 deletions
|
@ -306,7 +306,7 @@ class AmfControllerTest < ActionController::TestCase
|
|||
# NOTE: looks from the API changes that this now expects a timestamp
|
||||
# instead of a version number...
|
||||
# try to get version 1
|
||||
v1 = ways(:way_with_versions_v1)
|
||||
v1 = ways(:way_with_versions_v2)
|
||||
{ latest.id => "",
|
||||
v1.way_id => v1.timestamp.strftime("%d %b %Y, %H:%M:%S")
|
||||
}.each do |id, t|
|
||||
|
@ -346,7 +346,7 @@ class AmfControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_getway_old_nonexistent
|
||||
# try to get the last version+10 (shoudn't exist)
|
||||
# try to get the last version-10 (shoudn't exist)
|
||||
v1 = ways(:way_with_versions_v1)
|
||||
# try to get last visible version of non-existent way
|
||||
# try to get specific version of non-existent way
|
||||
|
@ -366,6 +366,23 @@ class AmfControllerTest < ActionController::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_getway_old_invisible
|
||||
v1 = ways(:invisible_way)
|
||||
# try to get deleted version
|
||||
[[v1.way_id, (v1.timestamp + 10).strftime("%d %b %Y, %H:%M:%S")]
|
||||
].each do |id, t|
|
||||
amf_content "getway_old", "/1", [id, t]
|
||||
post :amf_read
|
||||
assert_response :success
|
||||
amf_parse_response
|
||||
returned_way = amf_result("/1")
|
||||
assert_equal -1, returned_way[0]
|
||||
assert returned_way[3].nil?
|
||||
assert returned_way[4].nil?
|
||||
assert returned_way[5].nil?
|
||||
end
|
||||
end
|
||||
|
||||
def test_getway_history
|
||||
latest = current_ways(:way_with_versions)
|
||||
oldest = ways(:way_with_versions_v1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue