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
Jérome Perrin
gitlab-ce
Commits
3fbcc511
Commit
3fbcc511
authored
Oct 02, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README cache key to use full project namespace
parent
dbc85bfa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
spec/helpers/projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+2
-2
No files found.
app/helpers/projects_helper.rb
View file @
3fbcc511
...
...
@@ -296,7 +296,7 @@ module ProjectsHelper
def
readme_cache_key
sha
=
@project
.
commit
.
try
(
:sha
)
||
'nil'
[
@project
.
id
,
sha
,
"readme"
].
join
(
'-'
)
[
@project
.
path_with_namespace
,
sha
,
"readme"
].
join
(
'-'
)
end
def
round_commit_count
(
project
)
...
...
spec/helpers/projects_helper_spec.rb
View file @
3fbcc511
...
...
@@ -61,13 +61,13 @@ describe ProjectsHelper do
end
it
"returns a valid cach key"
do
expect
(
helper
.
send
(
:readme_cache_key
)).
to
eq
(
"
#{
project
.
id
}
-
#{
project
.
commit
.
id
}
-readme"
)
expect
(
helper
.
send
(
:readme_cache_key
)).
to
eq
(
"
#{
project
.
path_with_namespace
}
-
#{
project
.
commit
.
id
}
-readme"
)
end
it
"returns a valid cache key if HEAD does not exist"
do
allow
(
project
).
to
receive
(
:commit
)
{
nil
}
expect
(
helper
.
send
(
:readme_cache_key
)).
to
eq
(
"
#{
project
.
id
}
-nil-readme"
)
expect
(
helper
.
send
(
:readme_cache_key
)).
to
eq
(
"
#{
project
.
path_with_namespace
}
-nil-readme"
)
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