]> git.openstreetmap.org Git - rails.git/commitdiff
Fix rubocop warnings
authorTom Hughes <tom@compton.nu>
Sun, 7 Jul 2019 15:30:04 +0000 (16:30 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 7 Jul 2019 15:30:04 +0000 (16:30 +0100)
lib/rich_text.rb
test/controllers/geocoder_controller_test.rb

index 2b3e07d6acb72b0221379ea0d0a80c681f383b78..1de7b882b2ae0da6cf7aa6e22557d9b547ac3431 100644 (file)
@@ -37,7 +37,7 @@ module RichText
           link_size += link.content.length
         end
 
           link_size += link.content.length
         end
 
-        link_proportion = link_size.to_f / doc.content.length.to_f
+        link_proportion = link_size.to_f / doc.content.length
       end
 
       spammy_phrases = SPAMMY_PHRASES.count do |phrase|
       end
 
       spammy_phrases = SPAMMY_PHRASES.count do |phrase|
index 1a14351824129c64d56eee1785927d78eca6e813..f8a4eed1964e84fd44cd7ff31f9a0dbf6a2769cf 100644 (file)
@@ -236,9 +236,9 @@ class GeocoderControllerTest < ActionController::TestCase
   ##
   # Test identification of US zipcodes
   def test_identify_us_postcode
   ##
   # Test identification of US zipcodes
   def test_identify_us_postcode
-    [
-      "12345",
-      "12345-6789"
+    %w[
+      12345
+      12345-6789
     ].each do |code|
       post :search, :params => { :query => code }
       assert_response :success
     ].each do |code|
       post :search, :params => { :query => code }
       assert_response :success