summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-10-02 13:03:51 -0700
committerStan Hu <stanhu@gmail.com>2015-10-02 13:26:42 -0700
commit3fbcc51102ad12948efe7d0fd1d69c1150aba416 (patch)
tree56e7476766ecb913d9cd6460c6d48972fd5ba012
parentdbc85bfa01d9ee37e466bd537a20f1cfde89be9f (diff)
downloadgitlab-ce-3fbcc51102ad12948efe7d0fd1d69c1150aba416.tar.gz
Update README cache key to use full project namespace
-rw-r--r--app/helpers/projects_helper.rb2
-rw-r--r--spec/helpers/projects_helper_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 7b4747ce3d7..a0220af4c30 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -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)
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb
index 99abb95d906..53e56ebff44 100644
--- a/spec/helpers/projects_helper_spec.rb
+++ b/spec/helpers/projects_helper_spec.rb
@@ -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