Fix various code comments

These were found as part of #3233
This commit is contained in:
Andy Allan 2021-07-21 11:24:06 +01:00
parent b7bedff1ce
commit 37b03e47c6
13 changed files with 15 additions and 15 deletions

View 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

View 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

View 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)

View 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

View 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
##

View 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

View 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
##

View 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")

View 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

View 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

View 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)

View 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"]

View 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")