Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-05-12 13:33:26 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-05-12 15:16:25 +0300
commit1028e05378f1fd25b49d95f36cf577a2b819844d (patch)
treedd8be4f2a610fc1f344cef3950087248c2aebdcd /spec
parentf938f9441b908ed90c519f1ad208c68dcfb2dde2 (diff)
Add parent full path to project list cache key
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/projects_helper_spec.rb6
-rw-r--r--spec/models/namespace_spec.rb6
2 files changed, 12 insertions, 0 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb
index be97973c693..ceabf0caf31 100644
--- a/spec/helpers/projects_helper_spec.rb
+++ b/spec/helpers/projects_helper_spec.rb
@@ -70,6 +70,12 @@ describe ProjectsHelper do
expect(helper.project_list_cache_key(project)).to include(project.namespace.cache_key)
end
+ it "includes the parent namespace in case of subgroup" do
+ project = create(:project, group: create(:group, :nested))
+
+ expect(helper.project_list_cache_key(project)).to include("parent/#{project.namespace.parent.path}")
+ end
+
it "includes the project" do
expect(helper.project_list_cache_key(project)).to include(project.cache_key)
end
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb
index 8624616316c..ca61e34b78e 100644
--- a/spec/models/namespace_spec.rb
+++ b/spec/models/namespace_spec.rb
@@ -332,4 +332,10 @@ describe Namespace, models: true do
it { expect(group.all_projects.to_a).to eq([project2, project1]) }
end
+
+ describe '#parent_full_path' do
+ let(:namespace) { create(:group, :nested) }
+
+ it { expect(namespace.parent_full_path).to eq(namespace.parent.path) }
+ end
end