X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/09f6b8348607e709729d9e3c8d2678a668ab50bb..212fe75b6fd26d01dfacf31650e7f71eb7f06a63:/test/models/node_test.rb diff --git a/test/models/node_test.rb b/test/models/node_test.rb index 664bfb260..94cb5ec81 100644 --- a/test/models/node_test.rb +++ b/test/models/node_test.rb @@ -435,4 +435,13 @@ class NodeTest < ActiveSupport::TestCase node.update_from(new_node, user) end end + + test "raises id precondition exception when deleting" do + user = create(:user) + node = Node.new(:id => 23, :visible => true) + new_node = Node.new(:id => 42, :visible => false) + assert_raises OSM::APIPreconditionFailedError do + node.delete_with_history!(new_node, user) + end + end end