Skip to content
Snippets Groups Projects
Commit 3fbcc511 authored by Stan Hu's avatar Stan Hu
Browse files

Update README cache key to use full project namespace

parent dbc85bfa
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment