diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-05 14:23:01 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-05 14:23:01 +0200 |
commit | 4e88ca12060df0c6e73a1eed74d6a7f6e42d7b58 (patch) | |
tree | aa78d1c70415af2ab0a33ec6790b7217f7ecf9d0 /spec | |
parent | 17dccc35ca4754405b87c87f81daec34e02ea7a1 (diff) | |
download | gitlab-ce-4e88ca12060df0c6e73a1eed74d6a7f6e42d7b58.tar.gz |
Hide "New subgroup" links when subgroups are not supported
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/groups/show_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb index 303013e59d5..501086fce80 100644 --- a/spec/features/groups/show_spec.rb +++ b/spec/features/groups/show_spec.rb @@ -24,4 +24,34 @@ feature 'Group show page' do it_behaves_like "an autodiscoverable RSS feed without an RSS token" end + + context 'subgroup support' do + let(:user) { create(:user) } + + before do + group.add_owner(user) + sign_in(user) + end + context 'when subgroups are supported', :js do + before do + allow(Group).to receive(:supports_nested_groups?) { true } + visit path + end + + it 'allows creating subgroups' do + expect(page).to have_css("li[data-text='New subgroup']", visible: false) + end + end + + context 'when subgroups are not supported' do + before do + allow(Group).to receive(:supports_nested_groups?) { false } + visit path + end + + it 'allows creating subgroups' do + expect(page).not_to have_selector("li[data-text='New subgroup']", visible: false) + end + end + end end |