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
9062e315
Commit
9062e315
authored
Feb 10, 2021
by
Himanshu Kapoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip wiki page events if title is missing
parent
8a65ba1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
lib/gitlab/git/wiki.rb
lib/gitlab/git/wiki.rb
+2
-0
spec/models/event_spec.rb
spec/models/event_spec.rb
+9
-3
No files found.
lib/gitlab/git/wiki.rb
View file @
9062e315
...
@@ -151,6 +151,8 @@ module Gitlab
...
@@ -151,6 +151,8 @@ module Gitlab
end
end
def
gitaly_find_page
(
title
:,
version:
nil
,
dir:
nil
)
def
gitaly_find_page
(
title
:,
version:
nil
,
dir:
nil
)
return
unless
title
.
present?
wiki_page
,
version
=
gitaly_wiki_client
.
find_page
(
title:
title
,
version:
version
,
dir:
dir
)
wiki_page
,
version
=
gitaly_wiki_client
.
find_page
(
title:
title
,
version:
version
,
dir:
dir
)
return
unless
wiki_page
return
unless
wiki_page
...
...
spec/models/event_spec.rb
View file @
9062e315
...
@@ -744,13 +744,19 @@ RSpec.describe Event do
...
@@ -744,13 +744,19 @@ RSpec.describe Event do
describe
'#wiki_page and #wiki_page?'
do
describe
'#wiki_page and #wiki_page?'
do
context
'for a wiki page event'
do
context
'for a wiki page event'
do
let
(
:wiki_page
)
do
let
(
:wiki_page
)
{
create
(
:wiki_page
,
project:
project
)
}
create
(
:wiki_page
,
project:
project
)
end
subject
(
:event
)
{
create
(
:wiki_page_event
,
project:
project
,
wiki_page:
wiki_page
)
}
subject
(
:event
)
{
create
(
:wiki_page_event
,
project:
project
,
wiki_page:
wiki_page
)
}
it
{
is_expected
.
to
have_attributes
(
wiki_page?:
be_truthy
,
wiki_page:
wiki_page
)
}
it
{
is_expected
.
to
have_attributes
(
wiki_page?:
be_truthy
,
wiki_page:
wiki_page
)
}
context
'title is empty'
do
before
do
expect
(
event
.
target
).
to
receive
(
:canonical_slug
).
and_return
(
''
)
end
it
{
is_expected
.
to
have_attributes
(
wiki_page?:
be_truthy
,
wiki_page:
nil
)
}
end
end
end
context
'for any other event'
do
context
'for any other event'
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