summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-25 15:26:18 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-25 15:26:18 +0100
commit56797a84c82b673d15cbfa6825e65c63e8d1636e (patch)
tree08cc3486670de066ed0f4d4b8ebb8734055bb4d2
parente04830445619b17bd2fce34583f08fc295cb30ad (diff)
downloadgitlab-ce-56797a84c82b673d15cbfa6825e65c63e8d1636e.tar.gz
Remove shared example and improve sub_group_issuables_spec.rbfix-filtered-search-issuable-empty-state-exception
-rw-r--r--spec/features/projects/sub_group_issuables_spec.rb31
-rw-r--r--spec/support/features/has_subgroup_title_spec.rb8
2 files changed, 17 insertions, 22 deletions
diff --git a/spec/features/projects/sub_group_issuables_spec.rb b/spec/features/projects/sub_group_issuables_spec.rb
index 848a06cf335..cf21b208f65 100644
--- a/spec/features/projects/sub_group_issuables_spec.rb
+++ b/spec/features/projects/sub_group_issuables_spec.rb
@@ -1,29 +1,32 @@
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) }
+ let!(:group) { create(:group, name: 'group') }
+ let!(:subgroup) { create(:group, 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 'shows the full subgroup title when issues index page is empty' do
+ visit namespace_project_issues_path(project.namespace.to_param, project.to_param)
- it_behaves_like 'has subgroup title', 'parentgroup', 'subgroup', 'project'
+ expect_to_have_full_subgroup_title
end
- context 'empty merge request index' do
- before do
- visit namespace_project_merge_requests_path(project.namespace, project)
- end
+ it 'shows the full subgroup title when merge requests index page is empty' do
+ visit namespace_project_merge_requests_path(project.namespace.to_param, project.to_param)
- it_behaves_like 'has subgroup title', 'parentgroup', 'subgroup', 'project'
+ expect_to_have_full_subgroup_title
+ end
+
+ def expect_to_have_full_subgroup_title
+ title = find('.title-container')
+
+ expect(title).not_to have_selector '.initializing'
+ expect(title).to have_content 'group / subgroup / project'
end
end
diff --git a/spec/support/features/has_subgroup_title_spec.rb b/spec/support/features/has_subgroup_title_spec.rb
deleted file mode 100644
index 2a852817c94..00000000000
--- a/spec/support/features/has_subgroup_title_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-shared_examples 'has subgroup title' do |parent_group_name, subgroup_name, project_name|
- it 'shows 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