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
dd4b7897
Commit
dd4b7897
authored
Mar 17, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for Repository#build_cache
parent
3d7feeed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+30
-0
No files found.
spec/models/repository_spec.rb
View file @
dd4b7897
...
@@ -780,4 +780,34 @@ describe Repository, models: true do
...
@@ -780,4 +780,34 @@ describe Repository, models: true do
end
end
end
end
end
end
describe
'#build_cache'
do
let
(
:cache
)
{
repository
.
send
(
:cache
)
}
it
'builds the caches if they do not already exist'
do
expect
(
cache
).
to
receive
(
:exist?
).
exactly
(
repository
.
cache_keys
.
length
).
times
.
and_return
(
false
)
repository
.
cache_keys
.
each
do
|
key
|
expect
(
repository
).
to
receive
(
key
)
end
repository
.
build_cache
end
it
'does not build any caches that already exist'
do
expect
(
cache
).
to
receive
(
:exist?
).
exactly
(
repository
.
cache_keys
.
length
).
times
.
and_return
(
true
)
repository
.
cache_keys
.
each
do
|
key
|
expect
(
repository
).
to_not
receive
(
key
)
end
repository
.
build_cache
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