X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/09f6b8348607e709729d9e3c8d2678a668ab50bb..927335b5c4410934d032f8e11c9659852171edd7:/test/models/relation_test.rb 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