Revert changes as a hotfix (#3964)

This commit is contained in:
Andy Zhao 2019-09-06 11:54:35 -04:00 committed by Ben Halpern
parent aadd376f9c
commit 8a4030c25d
3 changed files with 0 additions and 16 deletions

View file

@ -77,12 +77,4 @@ class ApplicationController < ActionController::Base
def touch_current_user
current_user.touch
end
def routing_error
if params[:path].start_with?("api")
render json: { error: "not found", status: 404 }, status: :not_found
else
render "public/404.html", status: :not_found, layout: false
end
end
end

View file

@ -380,8 +380,6 @@ Rails.application.routes.draw do
get "/:username" => "stories#index"
root "stories#index"
match '*path', to: 'application#routing_error', via: [:get, :post]
end
# rubocop:enable Metrics/BlockLength

View file

@ -188,12 +188,6 @@ RSpec.describe "Api::V0::Articles", type: :request do
expected_order = json_response.map { |resp| resp["published"] }
expect(expected_order).to eq([false, true])
end
it "returns 404 JSON error for an unsupported option" do
get me_api_articles_path(status: :foobar), params: { access_token: access_token.token }
expect(response).to have_http_status(:not_found)
expect(json_response["error"]).to eq("not found")
end
end
end