Commit f976a897 authored by Mark Chao's avatar Mark Chao

Rename feature flag

parent ae047419
......@@ -40,7 +40,7 @@ module EE
def update_approvers
return yield unless project.feature_available?(:code_owners)
if ::Feature.enabled?(:approval_rule)
if ::Feature.enabled?(:approval_rules, project)
results = yield
merge_requests_for_source_branch.each(&:sync_code_owners_with_approvers)
......
......@@ -79,7 +79,7 @@ module EE
def sync_approval_rules
return if ::Feature.enabled?(:approval_rules, project)
return unless project.previous_changes.include?(:approvals_before_merge)
return if ::Feature.enabled?(:approval_rule)
return if ::Feature.enabled?(:approval_rules, project)
project.approval_rules.update_all(approvals_required: project.approvals_before_merge)
end
......
......@@ -4,7 +4,7 @@ module API
module Helpers
module ApprovalHelpers
def present_approval(merge_request)
if Feature.enabled?(:approval_rule)
if Feature.enabled?(:approval_rules, merge_request.project)
present merge_request.approval_state, with: ::EE::API::Entities::ApprovalState, current_user: current_user
else
present merge_request.present(current_user: current_user), with: ::EE::API::Entities::MergeRequestApprovals, current_user: current_user
......
......@@ -82,7 +82,6 @@ describe MergeRequestPresenter do
let!(:approver) { create(:approver, target: resource) }
before do
stub_feature_flags approval_rule: true
resource.approvals.create!(user: approver.user)
end
......@@ -149,10 +148,6 @@ describe MergeRequestPresenter do
let!(:private_approver_group) { create(:approver_group, target: resource, group: private_group) }
let!(:approver) { create(:approver, target: resource) }
before do
stub_feature_flags approval_rule: true
end
subject { described_class.new(resource, current_user: user).all_approvers_including_groups }
it do
......
......@@ -399,10 +399,6 @@ describe "API::MergeRequestApprovals with approval_rule enabled" do
set(:approver) { create :user }
set(:group) { create :group }
before do
stub_feature_flags(approval_rule: true)
end
describe 'GET :id/merge_requests/:merge_request_iid/approvals' do
let!(:rule) { create(:approval_merge_request_rule, merge_request: merge_request, approvals_required: 2, name: 'foo') }
......
......@@ -143,8 +143,6 @@ describe MergeRequests::RefreshService do
let(:new_owners) { [owner] }
before do
stub_feature_flags(approval_rule: true)
relevant_merge_requests.each do |merge_request|
expect(::Gitlab::CodeOwners).to receive(:for_merge_request).with(merge_request).and_return(new_owners)
end
......
......@@ -254,8 +254,6 @@ describe Projects::UpdateService, '#execute' do
context 'when approval_rule feature is enabled' do
it "does not update approval_rules' approvals_required" do
stub_feature_flags(approval_rule: true)
rule = create(:approval_project_rule, project: project)
expect 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