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
9b97be8c
Commit
9b97be8c
authored
May 02, 2017
by
Douglas Barbosa Alexandre
Committed by
Robert Speicher
May 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update last_repository_updated_at when the wiki is updated
parent
2d2f13f1
Changes
2
Hide 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 @
9b97be8c
...
...
@@ -196,7 +196,7 @@ class ProjectWiki
end
def
update_project_activity
@project
.
touch
(
:last_activity_at
)
@project
.
touch
(
:last_activity_at
,
:last_repository_updated_at
)
end
def
update_elastic_index
...
...
spec/models/project_wiki_spec.rb
View file @
9b97be8c
...
...
@@ -221,9 +221,12 @@ describe ProjectWiki, models: true do
end
it
'updates project activity'
do
expect
(
subject
).
to
receive
(
:update_project_activity
)
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
...
...
@@ -248,9 +251,12 @@ describe ProjectWiki, models: true do
end
it
'updates project activity'
do
expect
(
subject
).
to
receive
(
:update_project_activity
)
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
...
...
@@ -266,9 +272,12 @@ describe ProjectWiki, models: true do
end
it
'updates project activity'
do
expect
(
subject
).
to
receive
(
:update_project_activity
)
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
...
...
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