]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/api/changesets_controller_test.rb
Fix new rubocop warnings
[rails.git] / test / controllers / api / changesets_controller_test.rb
index 4339844140e2df80bcc856a7cfff56137dacb031..b4bc4a5abd21345126dd08b75fe88381dfd940fc 100644 (file)
@@ -199,7 +199,7 @@ module Api
       assert_equal Settings.api_version, js["version"]
       assert_equal Settings.generator, js["generator"]
       assert_equal changeset.id, js["changeset"]["id"]
-      assert js["changeset"]["open"]
+      assert_operator js["changeset"], :[], "open"
       assert_equal changeset.created_at.xmlschema, js["changeset"]["created_at"]
       assert_nil js["changeset"]["closed_at"]
       assert_nil js["changeset"]["tags"]
@@ -215,7 +215,7 @@ module Api
       assert_equal Settings.api_version, js["version"]
       assert_equal Settings.generator, js["generator"]
       assert_equal changeset.id, js["changeset"]["id"]
-      assert js["changeset"]["open"]
+      assert_operator js["changeset"], :[], "open"
       assert_equal changeset.created_at.xmlschema, js["changeset"]["created_at"]
       assert_nil js["changeset"]["closed_at"]
       assert_nil js["changeset"]["tags"]
@@ -697,10 +697,10 @@ module Api
 
       # check that the changeset bbox is within bounds
       cs = Changeset.find(changeset_id)
-      assert cs.min_lon >= -180 * GeoRecord::SCALE, "Minimum longitude (#{cs.min_lon / GeoRecord::SCALE}) should be >= -180 to be valid."
-      assert cs.max_lon <= 180 * GeoRecord::SCALE, "Maximum longitude (#{cs.max_lon / GeoRecord::SCALE}) should be <= 180 to be valid."
-      assert cs.min_lat >= -90 * GeoRecord::SCALE, "Minimum latitude (#{cs.min_lat / GeoRecord::SCALE}) should be >= -90 to be valid."
-      assert cs.max_lat <= 90 * GeoRecord::SCALE, "Maximum latitude (#{cs.max_lat / GeoRecord::SCALE}) should be <= 90 to be valid."
+      assert_operator cs.min_lon, :>=, -180 * GeoRecord::SCALE, "Minimum longitude (#{cs.min_lon / GeoRecord::SCALE}) should be >= -180 to be valid."
+      assert_operator cs.max_lon, :<=, 180 * GeoRecord::SCALE, "Maximum longitude (#{cs.max_lon / GeoRecord::SCALE}) should be <= 180 to be valid."
+      assert_operator cs.min_lat, :>=, -90 * GeoRecord::SCALE, "Minimum latitude (#{cs.min_lat / GeoRecord::SCALE}) should be >= -90 to be valid."
+      assert_operator cs.max_lat, :<=, 90 * GeoRecord::SCALE, "Maximum latitude (#{cs.max_lat / GeoRecord::SCALE}) should be <= 90 to be valid."
     end
 
     ##