Commit 3fbcc511 authored by Stan Hu's avatar Stan Hu

Update README cache key to use full project namespace

parent dbc85bfa
...@@ -296,7 +296,7 @@ module ProjectsHelper ...@@ -296,7 +296,7 @@ module ProjectsHelper
def readme_cache_key def readme_cache_key
sha = @project.commit.try(:sha) || 'nil' sha = @project.commit.try(:sha) || 'nil'
[@project.id, sha, "readme"].join('-') [@project.path_with_namespace, sha, "readme"].join('-')
end end
def round_commit_count(project) def round_commit_count(project)
......
...@@ -61,13 +61,13 @@ describe ProjectsHelper do ...@@ -61,13 +61,13 @@ describe ProjectsHelper do
end end
it "returns a valid cach key" do 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 end
it "returns a valid cache key if HEAD does not exist" do it "returns a valid cache key if HEAD does not exist" do
allow(project).to receive(:commit) { nil } 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 end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment