X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/09f6b8348607e709729d9e3c8d2678a668ab50bb..01c2aabd95ea9f8dcab18d6c7dd2a88fcbd87a68:/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