Rubocop fixes for ruby 2.5
This commit is contained in:
parent
f28e236bdd
commit
1ca77d6dda
8 changed files with 41 additions and 53 deletions
|
@ -165,12 +165,10 @@ module Api
|
|||
# check that a changeset that doesn't exist returns an appropriate message
|
||||
def test_show_not_found
|
||||
[0, -32, 233455644, "afg", "213"].each do |id|
|
||||
begin
|
||||
get :show, :params => { :id => id }
|
||||
assert_response :not_found, "should get a not found"
|
||||
rescue ActionController::UrlGenerationError => ex
|
||||
assert_match(/No route matches/, ex.to_s)
|
||||
end
|
||||
get :show, :params => { :id => id }
|
||||
assert_response :not_found, "should get a not found"
|
||||
rescue ActionController::UrlGenerationError => ex
|
||||
assert_match(/No route matches/, ex.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -239,23 +237,19 @@ module Api
|
|||
|
||||
# First try to do it with no auth
|
||||
cs_ids.each do |id|
|
||||
begin
|
||||
put :close, :params => { :id => id }
|
||||
assert_response :unauthorized, "Shouldn't be able close the non-existant changeset #{id}, when not authorized"
|
||||
rescue ActionController::UrlGenerationError => ex
|
||||
assert_match(/No route matches/, ex.to_s)
|
||||
end
|
||||
put :close, :params => { :id => id }
|
||||
assert_response :unauthorized, "Shouldn't be able close the non-existant changeset #{id}, when not authorized"
|
||||
rescue ActionController::UrlGenerationError => ex
|
||||
assert_match(/No route matches/, ex.to_s)
|
||||
end
|
||||
|
||||
# Now try with auth
|
||||
basic_authorization create(:user).email, "test"
|
||||
cs_ids.each do |id|
|
||||
begin
|
||||
put :close, :params => { :id => id }
|
||||
assert_response :not_found, "The changeset #{id} doesn't exist, so can't be closed"
|
||||
rescue ActionController::UrlGenerationError => ex
|
||||
assert_match(/No route matches/, ex.to_s)
|
||||
end
|
||||
put :close, :params => { :id => id }
|
||||
assert_response :not_found, "The changeset #{id} doesn't exist, so can't be closed"
|
||||
rescue ActionController::UrlGenerationError => ex
|
||||
assert_match(/No route matches/, ex.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue