Commit 7aca6dfd authored by ddash2's avatar ddash2

Added a spec to test wiki with json request

parent e354292a
......@@ -8,6 +8,8 @@ module WikiActions
extend ActiveSupport::Concern
included do
before_action { respond_to :html }
before_action :authorize_read_wiki!
before_action :authorize_create_wiki!, only: [:edit, :create]
before_action :authorize_admin_wiki!, only: :destroy
......
---
title: Wiki controller should not crash with non-html format
merge_request: 37466
author:
type: fixed
......@@ -61,6 +61,14 @@ RSpec.shared_examples 'wiki controller actions' do
expect(assigns(:sidebar_wiki_entries)).to be_nil
expect(assigns(:sidebar_limited)).to be_nil
end
context 'when the request is of non-html format' do
it 'returns a 404 error' do
get :pages, params: routing_params.merge(format: 'json')
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
describe 'GET #history' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment