BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0a002e23
Unverified
Commit
0a002e23
authored
Dec 22, 2017
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement ResetProjectCacheService
parent
f58cc2ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
reset_project_cache_service.rb
app/services/reset_project_cache_service.rb
+1
-0
reset_project_cache_service_spec.rb
spec/services/reset_project_cache_service_spec.rb
+18
-2
No files found.
app/services/reset_project_cache_service.rb
View file @
0a002e23
class
ResetProjectCacheService
<
BaseService
def
execute
@project
.
increment!
(
:cache_index
)
end
end
spec/services/reset_project_cache_service_spec.rb
View file @
0a002e23
...
...
@@ -6,7 +6,23 @@ describe ResetProjectCacheService do
subject
{
described_class
.
new
(
project
,
user
).
execute
}
it
"resets project cache"
do
fail
context
'when project cache_index is nil'
do
before
do
project
.
cache_index
=
nil
end
it
'sets project cache_index to one'
do
expect
{
subject
}.
to
change
{
project
.
reload
.
cache_index
}.
from
(
nil
).
to
(
1
)
end
end
context
'when project cache_index is a numeric value'
do
before
do
project
.
update_attributes
(
cache_index:
1
)
end
it
'increments project cache index'
do
expect
{
subject
}.
to
change
{
project
.
reload
.
cache_index
}.
by
(
1
)
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