Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7aca6dfd
Commit
7aca6dfd
authored
Jul 21, 2020
by
ddash2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a spec to test wiki with json request
parent
e354292a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
app/controllers/concerns/wiki_actions.rb
app/controllers/concerns/wiki_actions.rb
+2
-0
changelogs/unreleased/209910-wiki-respond-not_acceptable.yml
changelogs/unreleased/209910-wiki-respond-not_acceptable.yml
+5
-0
spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb
...ared_examples/controllers/wiki_actions_shared_examples.rb
+8
-0
No files found.
app/controllers/concerns/wiki_actions.rb
View file @
7aca6dfd
...
@@ -8,6 +8,8 @@ module WikiActions
...
@@ -8,6 +8,8 @@ module WikiActions
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
included
do
included
do
before_action
{
respond_to
:html
}
before_action
:authorize_read_wiki!
before_action
:authorize_read_wiki!
before_action
:authorize_create_wiki!
,
only:
[
:edit
,
:create
]
before_action
:authorize_create_wiki!
,
only:
[
:edit
,
:create
]
before_action
:authorize_admin_wiki!
,
only: :destroy
before_action
:authorize_admin_wiki!
,
only: :destroy
...
...
changelogs/unreleased/209910-wiki-respond-not_acceptable.yml
0 → 100644
View file @
7aca6dfd
---
title
:
Wiki controller should not crash with non-html format
merge_request
:
37466
author
:
type
:
fixed
spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb
View file @
7aca6dfd
...
@@ -61,6 +61,14 @@ RSpec.shared_examples 'wiki controller actions' do
...
@@ -61,6 +61,14 @@ RSpec.shared_examples 'wiki controller actions' do
expect
(
assigns
(
:sidebar_wiki_entries
)).
to
be_nil
expect
(
assigns
(
:sidebar_wiki_entries
)).
to
be_nil
expect
(
assigns
(
:sidebar_limited
)).
to
be_nil
expect
(
assigns
(
:sidebar_limited
)).
to
be_nil
end
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
end
describe
'GET #history'
do
describe
'GET #history'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment