]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/way_test.rb
Merge remote-tracking branch 'upstream/pull/5234'
[rails.git] / test / models / way_test.rb
index 8d662b657229428ba3ea78f08464f0151ada43d5..36debfac082e6eba757431bbbce95dfb8764b4da 100644 (file)
@@ -290,4 +290,13 @@ class WayTest < ActiveSupport::TestCase
       way.update_from(new_way, user)
     end
   end
       way.update_from(new_way, user)
     end
   end
+
+  test "raises id precondition exception when deleting" do
+    user = create(:user)
+    way = Way.new(:id => 23, :visible => true)
+    new_way = Way.new(:id => 42, :visible => false)
+    assert_raises OSM::APIPreconditionFailedError do
+      way.delete_with_history!(new_way, user)
+    end
+  end
 end
 end