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