]> git.openstreetmap.org Git - rails.git/commitdiff
Fix various code comments
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 21 Jul 2021 10:24:06 +0000 (11:24 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 21 Jul 2021 10:24:23 +0000 (11:24 +0100)
These were found as part of #3233

13 files changed:
app/controllers/api/user_preferences_controller.rb
app/controllers/issues_controller.rb
app/helpers/banner_helper.rb
app/models/concerns/consistency_validations.rb
test/controllers/api/map_controller_test.rb
test/controllers/api/relations_controller_test.rb
test/controllers/api/tracepoints_controller_test.rb
test/controllers/api/traces_controller_test.rb
test/controllers/traces_controller_test.rb
test/lib/utf8_test.rb
test/models/message_test.rb
test/models/user_test.rb
test/test_helper.rb

index 40ccfccbbc4a222a841c67f312d6665a13998a10..02a23095addd70ef9a72dde3d84cad35a257b308 100644 (file)
@@ -1,4 +1,4 @@
-# Update and read user preferences, which are arbitrayr key/val pairs
+# Update and read user preferences, which are arbitrary key/val pairs
 module Api
   class UserPreferencesController < ApiController
     before_action :authorize
index f30ece3ec023d3dcef7523d8ad7584a8919d2c40..5940389397ca76e8b7b6d9a524a76d9df41185c0 100644 (file)
@@ -47,7 +47,7 @@ class IssuesController < ApplicationController
     @new_comment = IssueComment.new(:issue => @issue)
   end
 
-  # Status Transistions
+  # Status Transitions
   def resolve
     if @issue.resolve
       @issue.updated_by = current_user.id
index fef6eaa5e77c989c177eb0c15aed84687c844fbf..17c6eace3d4eb2cf4c4f24e5d208ab07925acdd7 100644 (file)
@@ -28,7 +28,7 @@ module BannerHelper
       index = cval.to_i
       cookies[ckey] = index - 1 if index.positive?
 
-      # pick banner with mininum queue position
+      # pick banner with minimum queue position
       next if index > min_index
 
       # or if equal queue position, pick banner with soonest end date (i.e. next expiring)
index 00c6ce9934b7b37c6a95f74e32a68d4678714668..8c89f61de9dfad633a31e65fa8356ad963d75817 100644 (file)
@@ -3,7 +3,7 @@ module ConsistencyValidations
 
   # Generic checks that are run for the updates and deletes of
   # node, ways and relations. This code is here to avoid duplication,
-  # and allow the extention of the checks without having to modify the
+  # and allow the extension of the checks without having to modify the
   # code in 6 places for all the updates and deletes. Some of these tests are
   # needed for creates, but are currently not run :-(
   # This will throw an exception if there is an inconsistency
index e9459b6a283692196b3ab26897f0979b5effcf0f..433e7a2afd6d0a386b83ef6421b8282edc700cd5 100644 (file)
@@ -13,7 +13,7 @@ module Api
       @goodbbox = %w[-0.1,-0.1,0.1,0.1 51.1,-0.1,51.2,0
                      -0.1,%20-0.1,%200.1,%200.1 -0.1edcd,-0.1d,0.1,0.1 -0.1E,-0.1E,0.1S,0.1N S0.1,W0.1,N0.1,E0.1]
       # That last item in the goodbbox really shouldn't be there, as the API should
-      # reall reject it, however this is to test to see if the api changes.
+      # really reject it, however this is to test to see if the api changes.
     end
 
     ##
index 44c6cd4eec1e817db0d615389403266f1f9e65a0..ec86e07a57ac242f60c71f11b90750695731b3df 100644 (file)
@@ -1009,7 +1009,7 @@ module Api
     ##
     # updates the relation (XML) +rel+ and
     # yields the new version of that relation into the block.
-    # the parsed XML doc is retured.
+    # the parsed XML doc is returned.
     def with_update(rel, headers)
       rel_id = rel.find("//osm/relation").first["id"].to_i
       put api_relation_path(:id => rel_id), :params => rel.to_s, :headers => headers
@@ -1029,7 +1029,7 @@ module Api
     ##
     # updates the relation (XML) +rel+ via the diff-upload API and
     # yields the new version of that relation into the block.
-    # the parsed XML doc is retured.
+    # the parsed XML doc is returned.
     def with_update_diff(rel, headers)
       rel_id = rel.find("//osm/relation").first["id"].to_i
       cs_id = rel.find("//osm/relation").first["changeset"].to_i
index d3fb195feb6ce42950b00bdbc03e83e645707679..a904e8127693f37e7ccb48900a3e8b0259311074 100644 (file)
@@ -13,7 +13,7 @@ module Api
       @goodbbox = %w[-0.1,-0.1,0.1,0.1 51.1,-0.1,51.2,0
                      -0.1,%20-0.1,%200.1,%200.1 -0.1edcd,-0.1d,0.1,0.1 -0.1E,-0.1E,0.1S,0.1N S0.1,W0.1,N0.1,E0.1]
       # That last item in the goodbbox really shouldn't be there, as the API should
-      # reall reject it, however this is to test to see if the api changes.
+      # really reject it, however this is to test to see if the api changes.
     end
 
     ##
index c2ddb6031f6742274d49854530ef1fdd369a22d0..52df899ba0778e8f2b600ddf14d6272827aa66da 100644 (file)
@@ -70,7 +70,7 @@ module Api
       assert_response :success
     end
 
-    # Check an anoymous trace can't be specifically fetched by another user
+    # Check an anonymous trace can't be specifically fetched by another user
     def test_show_anon
       anon_trace_file = create(:trace, :visibility => "private")
 
index 39a72568fe2eeff7bf94a0f16c13b31d0ffbc699..1c3dc2d31def9fc85db02a1d437d5593ea1143b4 100644 (file)
@@ -133,7 +133,7 @@ class TracesControllerTest < ActionDispatch::IntegrationTest
   # Check that the index of traces is displayed
   def test_index
     user = create(:user)
-    # The fourth test below is surpisingly sensitive to timestamp ordering when the timestamps are equal.
+    # The fourth test below is surprisingly sensitive to timestamp ordering when the timestamps are equal.
     trace_a = create(:trace, :visibility => "public", :timestamp => 4.seconds.ago) do |trace|
       create(:tracetag, :trace => trace, :tag => "London")
     end
@@ -255,7 +255,7 @@ class TracesControllerTest < ActionDispatch::IntegrationTest
   # Check the RSS feed
   def test_rss
     user = create(:user)
-    # The fourth test below is surpisingly sensitive to timestamp ordering when the timestamps are equal.
+    # The fourth test below is surprisingly sensitive to timestamp ordering when the timestamps are equal.
     trace_a = create(:trace, :visibility => "public", :timestamp => 4.seconds.ago) do |trace|
       create(:tracetag, :trace => trace, :tag => "London")
     end
index d90d5efa9787d6cf99cdf560d929faa3b02e3dcc..0eac9253db7db8bfab941a5d4144874d18098b9f 100644 (file)
@@ -12,6 +12,6 @@ class UTF8Test < ActiveSupport::TestCase
     assert_not UTF8.valid?("\xC2\xC2")     # 2-byte multibyte identifier, followed by another one
     assert_not UTF8.valid?("\x4a\x82")     # plain ASCII, followed by multibyte continuation
     assert_not UTF8.valid?("\x82\x82")     # multibyte continuations without multibyte identifier
-    assert_not UTF8.valid?("\xe1\x82\x4a") # three-byte identifier, contination and (incorrectly) plain ASCII
+    assert_not UTF8.valid?("\xe1\x82\x4a") # three-byte identifier, continuation and (incorrectly) plain ASCII
   end
 end
index 99a4710753a4ec4fef62eddc79c6d26d02b0bc80..d5391c6f8e2e6ad136154e5cbe02ca77482f67da 100644 (file)
@@ -51,7 +51,7 @@ class MessageTest < ActiveSupport::TestCase
                          "\xC2\xC2",     # 2-byte multibyte identifier, followed by another one
                          "\x4a\x82",     # plain ASCII, followed by multibyte continuation
                          "\x82\x82",     # multibyte continuations without multibyte identifier
-                         "\xe1\x82\x4a"] # three-byte identifier, contination and (incorrectly) plain ASCII
+                         "\xe1\x82\x4a"] # three-byte identifier, continuation and (incorrectly) plain ASCII
     invalid_sequences.each do |char|
       # create a message and save to the database
       msg = make_message(char, 1)
index 4c863272bf7d3cb92130b3b4c56486362c2f1a8f..c34b4b81fe310f092b02088ce8b321711ad45865 100644 (file)
@@ -76,7 +76,7 @@ class UserTest < ActiveSupport::TestCase
 
   def test_display_name_valid
     # Due to sanitisation in the view some of these that you might not
-    # expact are allowed
+    # expect are allowed
     # However, would they affect the xml planet dumps?
     ok = ["Name", "'me", "he\"", "<hr>", "*ho", "\"help\"@",
           "vergrößern", "ルシステムにも対応します", "輕觸搖晃的遊戲", "space space"]
index 505fa256876b2a9000965d59fda9923b67f6580d..6c8a798aac1d4106b6ac29dec0957c216d7323d6 100644 (file)
@@ -195,7 +195,7 @@ module ActiveSupport
 
     ##
     # Used to check that the error header and the forbidden responses are given
-    # when the owner of the changset has their data not marked as public
+    # when the owner of the changeset has their data not marked as public
     def assert_require_public_data(msg = "Shouldn't be able to use API when the user's data is not public")
       assert_response :forbidden, msg
       assert_equal("You must make your edits public to upload new data", @response.headers["Error"], "Wrong error message")