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
b6d4c88d
Commit
b6d4c88d
authored
Dec 20, 2016
by
Hiroyuki Sato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean-up spec
parent
16511728
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+4
-10
No files found.
spec/models/repository_spec.rb
View file @
b6d4c88d
...
...
@@ -146,17 +146,11 @@ describe Repository, models: true do
end
describe
'#cache_last_commit_id_for_path'
do
subject
{
repository
.
cache_last_commit_id_for_path
(
sample_commit
.
id
,
'.gitignore'
)
}
let
(
:cache
)
{
repository
.
send
(
:cache
)
}
let
(
:key
)
{
"last_commit_id_for_path:
#{
sample_commit
.
id
}
:
#{
Digest
::
SHA1
.
digest
(
'.gitignore'
)
}
"
}
before
{
cache
.
expire
(
key
)
}
after
{
cache
.
expire
(
key
)
}
it
"caches #last_commit_id_for_path"
do
expect
(
repository
).
to
receive
(
:last_commit_id_for_path
).
once
.
and_return
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
2
.
times
do
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8
'
)
e
nd
cache
=
repository
.
send
(
:cache
)
key
=
"last_commit_id_for_path:
#{
sample_commit
.
id
}
:
#{
Digest
::
SHA1
.
hexdigest
(
'.gitignore'
)
}
"
expect
(
cache
).
to
receive
(
:fetch
).
with
(
key
).
and_return
(
'c1acaa5
'
)
e
xpect
(
repository
.
cache_last_commit_id_for_path
(
sample_commit
.
id
,
'.gitignore'
)).
to
eq
(
'c1acaa5'
)
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