Commit 250658f2 authored by Alper Akgun's avatar Alper Akgun

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

Add actor to context_commits feature flag check

See merge request gitlab-org/gitlab!77154
parents 42d37f48 b5d8be93
...@@ -983,7 +983,7 @@ class Project < ApplicationRecord ...@@ -983,7 +983,7 @@ class Project < ApplicationRecord
end end
def context_commits_enabled? def context_commits_enabled?
Feature.enabled?(:context_commits, default_enabled: true) Feature.enabled?(:context_commits, self, 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.
......
...@@ -7552,6 +7552,46 @@ RSpec.describe Project, factory_default: :keep do ...@@ -7552,6 +7552,46 @@ RSpec.describe Project, factory_default: :keep do
end end
end end
describe '#context_commits_enabled?' do
let_it_be(:project) { create(:project) }
subject(:result) { project.context_commits_enabled? }
context 'when context_commits feature flag is enabled' do
before do
stub_feature_flags(context_commits: true)
end
it { is_expected.to be_truthy }
end
context 'when context_commits feature flag is disabled' do
before do
stub_feature_flags(context_commits: false)
end
it { is_expected.to be_falsey }
end
context 'when context_commits feature flag is enabled on this project' do
before do
stub_feature_flags(context_commits: project)
end
it { is_expected.to be_truthy }
end
context 'when context_commits feature flag is enabled on another project' do
let(:another_project) { create(:project) }
before do
stub_feature_flags(context_commits: another_project)
end
it { is_expected.to be_falsey }
end
end
private private
def finish_job(export_job) def finish_job(export_job)
......
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