diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-08-31 12:59:29 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-08-31 12:59:29 +0000 |
commit | d5d249764350b07340ed45068361d7249b3cf641 (patch) | |
tree | 8b952af9567c65beb4aa2ff5210e4555d7968f3b /spec/controllers | |
parent | a768e1b7048c17d4dde8ee086c7ff7dc2b43762e (diff) | |
parent | 04cd47dd5a08ca5cc84c44346b2893111da9594c (diff) | |
download | gitlab-ce-d5d249764350b07340ed45068361d7249b3cf641.tar.gz |
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/controllers')
-rw-r--r-- | spec/controllers/projects/pages_controller_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/controllers/projects/pages_controller_spec.rb b/spec/controllers/projects/pages_controller_spec.rb index 4d0111302f3..83c7744a231 100644 --- a/spec/controllers/projects/pages_controller_spec.rb +++ b/spec/controllers/projects/pages_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe Projects::PagesController do let(:user) { create(:user) } - let(:project) { create(:project, :public, :access_requestable) } + let(:project) { create(:project, :public) } let(:request_params) do { @@ -23,6 +23,17 @@ describe Projects::PagesController do expect(response).to have_http_status(200) end + + context 'when the project is in a subgroup' do + let(:group) { create(:group, :nested) } + let(:project) { create(:project, namespace: group) } + + it 'returns a 404 status code' do + get :show, request_params + + expect(response).to have_http_status(404) + end + end end describe 'DELETE destroy' do |