Commit a0c78cad authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-project-factory-pages-access-level-default' into 'master'

Fix factory default for pages_access_level

See merge request gitlab-org/gitlab-ce!30862
parents 78f461bb 0e624407
......@@ -25,7 +25,9 @@ FactoryBot.define do
issues_access_level ProjectFeature::ENABLED
merge_requests_access_level ProjectFeature::ENABLED
repository_access_level ProjectFeature::ENABLED
pages_access_level ProjectFeature::ENABLED
pages_access_level do
visibility_level == Gitlab::VisibilityLevel::PUBLIC ? ProjectFeature::ENABLED : ProjectFeature::PRIVATE
# we can't assign the delegated `#ci_cd_settings` attributes directly, as the
# `#ci_cd_settings` relation needs to be created first
......@@ -347,13 +347,13 @@ describe Projects::UpdateService do
context 'when updating #pages_access_level' do
subject(:call_service) do
update_project(project, admin, project_feature_attributes: { pages_access_level: ProjectFeature::PRIVATE })
update_project(project, admin, project_feature_attributes: { pages_access_level: ProjectFeature::ENABLED })
it 'updates the attribute' do
expect { call_service }
.to change { project.project_feature.pages_access_level }
it 'calls Projects::UpdatePagesConfigurationService' do
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment