Skip to content
Snippets Groups Projects
Commit 0e624407 authored by vshushlin's avatar vshushlin Committed by Stan Hu
Browse files

Fix factory default for pages_access_level

Pages access level currently depends on project visibilty
which is ignored by factory, this commit fixes that
parent 78f461bb
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