Fix new rubocopy warnings

This commit is contained in:
Tom Hughes 2015-08-18 20:57:14 +01:00
parent 7ce77006fa
commit c9d35839be
30 changed files with 173 additions and 102 deletions

View file

@ -1358,24 +1358,24 @@ class AmfControllerTest < ActionController::TestCase
def amf_parse_response
req = StringIO.new(@response.body)
req.read(2) # version
req.read(2) # version
# parse through any headers
headers = AMF.getint(req) # Read number of headers
headers.times do # Read each header
AMF.getstring(req) # |
req.getc # | skip boolean
AMF.getvalue(req) # |
headers = AMF.getint(req) # Read number of headers
headers.times do # Read each header
AMF.getstring(req) # |
req.getc # | skip boolean
AMF.getvalue(req) # |
end
# parse through responses
results = {}
bodies = AMF.getint(req) # Read number of bodies
bodies.times do # Read each body
message = AMF.getstring(req) # | get message name
AMF.getstring(req) # | get index in response sequence
AMF.getlong(req) # | get total size in bytes
args = AMF.getvalue(req) # | get response (probably an array)
bodies = AMF.getint(req) # Read number of bodies
bodies.times do # Read each body
message = AMF.getstring(req) # | get message name
AMF.getstring(req) # | get index in response sequence
AMF.getlong(req) # | get total size in bytes
args = AMF.getvalue(req) # | get response (probably an array)
results[message] = args
end
@amf_result = results

View file

@ -385,7 +385,7 @@ class ApiControllerTest < ActionController::TestCase
end
def test_permissions_oauth
@request.env["oauth.token"] = AccessToken.new do |token|
@request.env["oauth.token"] = AccessToken.new do |token|
# Just to test a few
token.allow_read_prefs = true
token.allow_write_api = true

View file

@ -1477,12 +1477,12 @@ EOF
# NOTE: the include method doesn't over-expand, like inserting
# a real method does. this is because we expect the client to
# know what it is doing!
check_after_include(changeset_id, 1, 1, [1, 1, 1, 1])
check_after_include(changeset_id, 3, 3, [1, 1, 3, 3])
check_after_include(changeset_id, 4, 2, [1, 1, 4, 3])
check_after_include(changeset_id, 2, 2, [1, 1, 4, 3])
check_after_include(changeset_id, -1, -1, [-1, -1, 4, 3])
check_after_include(changeset_id, -2, 5, [-2, -1, 4, 5])
check_after_include(changeset_id, 1, 1, [1, 1, 1, 1])
check_after_include(changeset_id, 3, 3, [1, 1, 3, 3])
check_after_include(changeset_id, 4, 2, [1, 1, 4, 3])
check_after_include(changeset_id, 2, 2, [1, 1, 4, 3])
check_after_include(changeset_id, -1, -1, [-1, -1, 4, 3])
check_after_include(changeset_id, -2, 5, [-2, -1, 4, 5])
end
##

View file

@ -446,7 +446,7 @@ class GeocoderControllerTest < ActionController::TestCase
xhr :get, :search_osm_nominatim_reverse, :lat => 51.7632, :lon => -0.0076, :zoom => 17
results_check :name => "Dinant Link Road, Broxbourne, Hertfordshire, East of England, England, EN11 8HX, United Kingdom",
:lat => 51.7634883, :lon => -0.0088373,
:type => "way", :id => 3489841, :zoom => 17
:type => "way", :id => 3489841, :zoom => 17
end
end

View file

@ -84,7 +84,7 @@ class OauthClientsControllerTest < ActionController::TestCase
:client_application => {
:name => "Test Application"
}
}, { :user => user }
}, { :user => user }
end
assert_response :success
assert_template "new"
@ -96,7 +96,7 @@ class OauthClientsControllerTest < ActionController::TestCase
:name => "Test Application",
:url => "http://test.example.com/"
}
}, { :user => user }
}, { :user => user }
end
assert_response :redirect
assert_redirected_to oauth_client_path(:id => ClientApplication.find_by_name("Test Application").id)
@ -163,7 +163,7 @@ class OauthClientsControllerTest < ActionController::TestCase
:name => "New Name",
:url => nil
}
}, { :user => user }
}, { :user => user }
assert_response :success
assert_template "edit"
@ -174,7 +174,7 @@ class OauthClientsControllerTest < ActionController::TestCase
:name => "New Name",
:url => "http://new.example.com/url"
}
}, { :user => user }
}, { :user => user }
assert_response :redirect
assert_redirected_to oauth_client_path(:id => client.id)
end

View file

@ -147,7 +147,7 @@ class OldNodeControllerTest < ActionController::TestCase
check_not_found_id_version(70000, 312344)
check_not_found_id_version(-1, -13)
check_not_found_id_version(nodes(:visible_node).id, 24354)
check_not_found_id_version(24356, nodes(:visible_node).version)
check_not_found_id_version(24356, nodes(:visible_node).version)
end
def check_not_found_id_version(id, version)

View file

@ -292,7 +292,7 @@ class SiteControllerTest < ActionController::TestCase
# Test editing a specific note
def test_edit_with_note
user = users(:public_user)
note = notes(:open_note)
note = notes(:open_note)
get :edit, { :note => note.id }, { :user => user.id }
assert_response :success