summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-12 21:32:08 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-12 21:32:08 +0100
commitdfe3ca5ec13a7fc2913b0ef26ddc87cecf0e134a (patch)
tree9570a1e993d0e5055c59f92fe60e4f5a835f310d
parentc47dfc9e56e783ad95690d050d88ec6bf742bd9d (diff)
downloadgitlab-ce-dfe3ca5ec13a7fc2913b0ef26ddc87cecf0e134a.tar.gz
Added specs to test for subgroup titles on issue and mr pages
-rw-r--r--spec/features/projects/sub_group_issuables_spec.rb29
-rw-r--r--spec/support/features/has_subgroup_title_spec.rb8
2 files changed, 37 insertions, 0 deletions
diff --git a/spec/features/projects/sub_group_issuables_spec.rb b/spec/features/projects/sub_group_issuables_spec.rb
new file mode 100644
index 00000000000..848a06cf335
--- /dev/null
+++ b/spec/features/projects/sub_group_issuables_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+describe 'Subgroup Issuables', :feature, :js do
+ let!(:parent_group) { create(:group, name: 'parentgroup') }
+ let!(:subgroup) { create(:group, parent: parent_group, name: 'subgroup') }
+ let!(:project) { create(:empty_project, namespace: subgroup, name: 'project') }
+ let(:user) { create(:user) }
+
+ before do
+ project.add_master(user)
+ login_as user
+ end
+
+ context 'empty issues index' do
+ before do
+ visit namespace_project_issues_path(project.namespace, project)
+ end
+
+ it_behaves_like 'has subgroup title', 'parentgroup', 'subgroup', 'project'
+ end
+
+ context 'empty merge request index' do
+ before do
+ visit namespace_project_merge_requests_path(project.namespace, project)
+ end
+
+ it_behaves_like 'has subgroup title', 'parentgroup', 'subgroup', 'project'
+ end
+end
diff --git a/spec/support/features/has_subgroup_title_spec.rb b/spec/support/features/has_subgroup_title_spec.rb
new file mode 100644
index 00000000000..b631eeeec3a
--- /dev/null
+++ b/spec/support/features/has_subgroup_title_spec.rb
@@ -0,0 +1,8 @@
+shared_examples 'has subgroup title' do |parent_group_name, subgroup_name, project_name|
+ it 'should show the full title' do
+ title = find('.title-container')
+
+ expect(title).not_to have_selector '.initializing'
+ expect(title).to have_content "#{parent_group_name} / #{subgroup_name} / #{project_name}"
+ end
+end