diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-08-31 15:59:29 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-08-31 15:59:29 +0300 |
commit | d5d249764350b07340ed45068361d7249b3cf641 (patch) | |
tree | 8b952af9567c65beb4aa2ff5210e4555d7968f3b /spec/models/project_spec.rb | |
parent | a768e1b7048c17d4dde8ee086c7ff7dc2b43762e (diff) | |
parent | 04cd47dd5a08ca5cc84c44346b2893111da9594c (diff) |
Merge branch 'zj-disable-pages-in-subgroups' into 'master'
Don't show references to Pages when not available
Closes #34864
See merge request !13888
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 11717ba39e8..3621023f4ca 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2234,6 +2234,28 @@ describe Project do end end + describe '#pages_available?' do + let(:project) { create(:project, group: group) } + + subject { project.pages_available? } + + before do + allow(Gitlab.config.pages).to receive(:enabled).and_return(true) + end + + context 'when the project is in a top level namespace' do + let(:group) { create(:group) } + + it { is_expected.to be(true) } + end + + context 'when the project is in a subgroup' do + let(:group) { create(:group, :nested) } + + it { is_expected.to be(false) } + end + end + describe '#remove_private_deploy_keys' do let!(:project) { create(:project) } |