X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/09f6b8348607e709729d9e3c8d2678a668ab50bb..30da09c5a1d0a788c3becae49cdeee822c23b298:/test/models/way_test.rb diff --git a/test/models/way_test.rb b/test/models/way_test.rb index 8d662b657..36debfac0 100644 --- a/test/models/way_test.rb +++ b/test/models/way_test.rb @@ -290,4 +290,13 @@ class WayTest < ActiveSupport::TestCase 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