Skip to content
Snippets Groups Projects
Commit a0c78cad authored by Stan Hu's avatar Stan Hu
Browse files

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
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
end
 
# we can't assign the delegated `#ci_cd_settings` attributes directly, as the
# `#ci_cd_settings` relation needs to be created first
Loading
Loading
Loading
Loading
@@ -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 })
end
 
it 'updates the attribute' do
expect { call_service }
.to change { project.project_feature.pages_access_level }
.to(ProjectFeature::PRIVATE)
.to(ProjectFeature::ENABLED)
end
 
it 'calls Projects::UpdatePagesConfigurationService' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment