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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
c0c31703
Commit
c0c31703
authored
Mar 07, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update project activity when pushing to a wiki repository
parent
8033da7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
app/workers/post_receive.rb
app/workers/post_receive.rb
+1
-1
spec/workers/post_receive_spec.rb
spec/workers/post_receive_spec.rb
+12
-0
No files found.
app/workers/post_receive.rb
View file @
c0c31703
...
...
@@ -55,7 +55,7 @@ class PostReceive
end
def
process_wiki_changes
(
post_received
)
# Nothing defined here yet.
post_received
.
project
.
touch
(
:last_activity_at
,
:last_repository_updated_at
)
end
def
log
(
message
)
...
...
spec/workers/post_receive_spec.rb
View file @
c0c31703
...
...
@@ -114,6 +114,18 @@ describe PostReceive do
end
end
describe
'#process_wiki_changes'
do
let
(
:gl_repository
)
{
"wiki-
#{
project
.
id
}
"
}
it
'updates project activity'
do
described_class
.
new
.
perform
(
gl_repository
,
key_id
,
base64_changes
)
expect
{
project
.
reload
}
.
to
change
(
project
,
:last_activity_at
)
.
and
change
(
project
,
:last_repository_updated_at
)
end
end
context
"webhook"
do
it
"fetches the correct project"
do
expect
(
Project
).
to
receive
(
:find_by
).
with
(
id:
project
.
id
.
to_s
)
...
...
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