fix the build
This commit is contained in:
parent
07e84a3afa
commit
8b74c7d325
|
@ -159,14 +159,7 @@ class ApplicationController < ActionController::Base
|
|||
(request.xhr?) ||
|
||||
((params[:external_id] || '').ends_with? '.json')
|
||||
|
||||
invalid_user =
|
||||
begin
|
||||
current_user
|
||||
rescue Discourse::InvalidAccess
|
||||
nil
|
||||
end
|
||||
|
||||
if show_json_errors || invalid_user
|
||||
if show_json_errors
|
||||
# HACK: do not use render_json_error for topics#show
|
||||
if request.params[:controller] == 'topics' && request.params[:action] == 'show'
|
||||
return render status: status_code, layout: false, plain: (status_code == 404 || status_code == 410) ? build_not_found_page(status_code) : I18n.t(type)
|
||||
|
|
|
@ -1065,13 +1065,6 @@ describe TopicsController do
|
|||
|
||||
expect(response.code.to_i).to be(403)
|
||||
expect(response.body).to eq(I18n.t("invalid_access"))
|
||||
|
||||
get :show, params: {
|
||||
topic_id: topic.id, slug: topic.slug, api_key: "bad"
|
||||
}, format: :html
|
||||
|
||||
expect(response.code.to_i).to be(403)
|
||||
expect(response.body).to eq(I18n.t("invalid_access"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue