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
9f2edaa8
Commit
9f2edaa8
authored
May 03, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update last_repository_updated_at when the wiki is updated
parent
91b5aaf7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
app/models/project_wiki.rb
app/models/project_wiki.rb
+1
-1
spec/models/project_wiki_spec.rb
spec/models/project_wiki_spec.rb
+15
-6
No files found.
app/models/project_wiki.rb
View file @
9f2edaa8
...
@@ -183,6 +183,6 @@ class ProjectWiki
...
@@ -183,6 +183,6 @@ class ProjectWiki
end
end
def
update_project_activity
def
update_project_activity
@project
.
touch
(
:last_activity_at
)
@project
.
touch
(
:last_activity_at
,
:last_repository_updated_at
)
end
end
end
end
spec/models/project_wiki_spec.rb
View file @
9f2edaa8
...
@@ -213,9 +213,12 @@ describe ProjectWiki, models: true do
...
@@ -213,9 +213,12 @@ describe ProjectWiki, models: true do
end
end
it
'updates project activity'
do
it
'updates project activity'
do
expect
(
subject
).
to
receive
(
:update_project_activity
)
subject
.
create_page
(
'Test Page'
,
'This is content'
)
subject
.
create_page
(
'Test Page'
,
'This is content'
)
project
.
reload
expect
(
project
.
last_activity_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
expect
(
project
.
last_repository_updated_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
end
end
end
end
...
@@ -240,9 +243,12 @@ describe ProjectWiki, models: true do
...
@@ -240,9 +243,12 @@ describe ProjectWiki, models: true do
end
end
it
'updates project activity'
do
it
'updates project activity'
do
expect
(
subject
).
to
receive
(
:update_project_activity
)
subject
.
update_page
(
@gollum_page
,
'Yet more content'
,
:markdown
,
'Updated page again'
)
subject
.
update_page
(
@gollum_page
,
'Yet more content'
,
:markdown
,
'Updated page again'
)
project
.
reload
expect
(
project
.
last_activity_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
expect
(
project
.
last_repository_updated_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
end
end
end
end
...
@@ -258,9 +264,12 @@ describe ProjectWiki, models: true do
...
@@ -258,9 +264,12 @@ describe ProjectWiki, models: true do
end
end
it
'updates project activity'
do
it
'updates project activity'
do
expect
(
subject
).
to
receive
(
:update_project_activity
)
subject
.
delete_page
(
@page
)
subject
.
delete_page
(
@page
)
project
.
reload
expect
(
project
.
last_activity_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
expect
(
project
.
last_repository_updated_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
end
end
end
end
...
...
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