summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-09-21 11:03:14 +0100
committerPhil Hughes <me@iamphill.com>2017-09-22 12:12:16 +0100
commiteab0ca8a0b2950dbbcf6662c34b2fc8313ba9bde (patch)
treead17deea946d5c9ee58459be5252d7c2ceef613f /spec/helpers
parent9f3227645442017e3518e2b0ba3e9270ebabfa06 (diff)
downloadgitlab-ce-eab0ca8a0b2950dbbcf6662c34b2fc8313ba9bde.tar.gz
Fixes dashboard/projects empty state showing when viewing personal projects
This was caused by the `@projects` value being empty when the current user does not have any personal projects.
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/projects_helper_spec.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb
index a76c75e0c08..7ded95d01af 100644
--- a/spec/helpers/projects_helper_spec.rb
+++ b/spec/helpers/projects_helper_spec.rb
@@ -420,22 +420,26 @@ describe ProjectsHelper do
end
end
- describe '#has_projects_or_name?' do
+ describe '#show_projects' do
let(:projects) do
create(:project)
Project.all
end
it 'returns true when there are projects' do
- expect(helper.has_projects_or_name?(projects, {})).to eq(true)
+ expect(helper.show_projects?(projects, {})).to eq(true)
end
it 'returns true when there are no projects but a name is given' do
- expect(helper.has_projects_or_name?(Project.none, name: 'foo')).to eq(true)
+ expect(helper.show_projects?(Project.none, name: 'foo')).to eq(true)
+ end
+
+ it 'returns true when there are no projects but personal is present' do
+ expect(helper.show_projects?(Project.none, personal: 'true')).to eq(true)
end
it 'returns false when there are no projects and there is no name' do
- expect(helper.has_projects_or_name?(Project.none, {})).to eq(false)
+ expect(helper.show_projects?(Project.none, {})).to eq(false)
end
end