Commit 5480697e authored by Stan Hu's avatar Stan Hu

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

EE countepart of Fix factory default for pages_access_level

See merge request gitlab-org/gitlab-ee!14731
parents 48de2d09 199c08f5
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe EE::Audit::ProjectFeatureChangesAuditor do
describe '#execute' do
let!(:user) { create(:user) }
let!(:project) { create(:project, visibility_level: 0) }
let!(:project) { create(:project, :pages_enabled, visibility_level: 0) }
let(:features) { project.project_feature }
let(:foo_instance) { described_class.new(user, features, project) }
......
......@@ -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
......
......@@ -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
......
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