Commit 657c5add authored by Etienne Baqué's avatar Etienne Baqué

Merge branch 'trial-active-root-ancestor' into 'master'

Check if root ancestor has an active trial

See merge request gitlab-org/gitlab!70109
parents 8aae5866 bb45b7dd
......@@ -173,7 +173,7 @@ module EE
end
def feature_available_non_trial?(feature)
feature_available?(feature.to_sym) && !trial_active?
feature_available?(feature.to_sym) && !root_ancestor.trial_active?
end
override :actual_plan
......
......@@ -490,6 +490,14 @@ RSpec.describe Namespace do
end
it { is_expected.to be_falsey }
context 'with a subgroup' do
let(:subgroup) { create(:group, parent: group) }
it 'feature is not available for the subgroup' do
expect(subgroup.feature_available_non_trial?(feature)).to be_falsey
end
end
end
end
......
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