Commit aa90900f authored by Stan Hu's avatar Stan Hu

Merge branch '320757-context-commits-ff-actor-change' into 'master'

Change actor of context_commits flag to group

See merge request gitlab-org/gitlab!78646
parents 7351eb4f 34592cbf
...@@ -987,7 +987,7 @@ class Project < ApplicationRecord ...@@ -987,7 +987,7 @@ class Project < ApplicationRecord
end end
def context_commits_enabled? def context_commits_enabled?
Feature.enabled?(:context_commits, self, default_enabled: :yaml) Feature.enabled?(:context_commits, self.group, default_enabled: :yaml)
end end
# LFS and hashed repository storage are required for using Design Management. # LFS and hashed repository storage are required for using Design Management.
......
...@@ -7784,7 +7784,8 @@ RSpec.describe Project, factory_default: :keep do ...@@ -7784,7 +7784,8 @@ RSpec.describe Project, factory_default: :keep do
end end
describe '#context_commits_enabled?' do describe '#context_commits_enabled?' do
let_it_be(:project) { create(:project) } let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, namespace: group) }
subject(:result) { project.context_commits_enabled? } subject(:result) { project.context_commits_enabled? }
...@@ -7804,19 +7805,19 @@ RSpec.describe Project, factory_default: :keep do ...@@ -7804,19 +7805,19 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
end end
context 'when context_commits feature flag is enabled on this project' do context 'when context_commits feature flag is enabled on project group' do
before do before do
stub_feature_flags(context_commits: project) stub_feature_flags(context_commits: group)
end end
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
end end
context 'when context_commits feature flag is enabled on another project' do context 'when context_commits feature flag is enabled on another group' do
let(:another_project) { create(:project) } let(:another_group) { create(:group) }
before do before do
stub_feature_flags(context_commits: another_project) stub_feature_flags(context_commits: another_group)
end end
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
......
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