]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/relation_test.rb
Convert social share helper library into a real helper
[rails.git] / test / models / relation_test.rb
index 5d7d0d46757a43a5bcd9073c4d5b4c2256cc223c..405dd353d3a94367280c1cea77a4b579aabce376 100644 (file)
@@ -323,4 +323,13 @@ class RelationTest < ActiveSupport::TestCase
       relation.update_from(new_relation, user)
     end
   end
       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
 end