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
Léo-Paul Géneau
gitlab-ce
Commits
1da8bd8f
Commit
1da8bd8f
authored
Dec 16, 2016
by
Hiroyuki Sato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs.
parent
1f192757
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+21
-0
No files found.
spec/models/repository_spec.rb
View file @
1da8bd8f
...
...
@@ -139,6 +139,27 @@ describe Repository, models: true do
it
{
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
}
end
describe
'#last_commit_id_for_path'
do
subject
{
repository
.
last_commit_id_for_path
(
sample_commit
.
id
,
'.gitignore'
)
}
it
{
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
}
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'
)
end
end
end
describe
'#find_commits_by_message'
do
it
'returns commits with messages containing a given string'
do
commit_ids
=
repository
.
find_commits_by_message
(
'submodule'
).
map
(
&
:id
)
...
...
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