X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/09f6b8348607e709729d9e3c8d2678a668ab50bb..7e7ede890e8e948236d3dbc48e24aca00cd01f62:/test/models/relation_test.rb?ds=inline diff --git a/test/models/relation_test.rb b/test/models/relation_test.rb index 5d7d0d467..405dd353d 100644 --- a/test/models/relation_test.rb +++ b/test/models/relation_test.rb @@ -323,4 +323,13 @@ class RelationTest < ActiveSupport::TestCase relation.update_from(new_relation, user) end end + + test "raises id precondition exception when deleting" do + user = create(:user) + relation = Relation.new(:id => 23, :visible => true) + new_relation = Relation.new(:id => 42, :visible => false) + assert_raises OSM::APIPreconditionFailedError do + relation.delete_with_history!(new_relation, user) + end + end end