Commit 5bf071c3 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Guard extend_reactivate_trial_button_data method with feature flag

parent b6f56547
...@@ -227,20 +227,30 @@ RSpec.describe EE::TrialHelper do ...@@ -227,20 +227,30 @@ RSpec.describe EE::TrialHelper do
allow(namespace).to receive(:actual_plan_name).and_return('ultimate') allow(namespace).to receive(:actual_plan_name).and_return('ultimate')
end end
context 'when trial can be extended' do context 'when feature flag is disabled' do
it { is_expected.to eq({ namespace_id: 1, plan_name: 'Ultimate', action: nil })}
end
context 'when feature flag is enabled' do
before do before do
allow(namespace).to receive(:can_extend_trial?).and_return(true) stub_feature_flags(allow_extend_reactivate_trial: true)
end end
it { is_expected.to eq({ namespace_id: 1, plan_name: 'Ultimate', action: 'extend' }) } context 'when trial can be extended' do
end before do
allow(namespace).to receive(:can_extend_trial?).and_return(true)
end
context 'when trial can be reactivated' do it { is_expected.to eq({ namespace_id: 1, plan_name: 'Ultimate', action: 'extend' }) }
before do
allow(namespace).to receive(:can_reactivate_trial?).and_return(true)
end end
it { is_expected.to eq({ namespace_id: 1, plan_name: 'Ultimate', action: 'reactivate' }) } context 'when trial can be reactivated' do
before do
allow(namespace).to receive(:can_reactivate_trial?).and_return(true)
end
it { is_expected.to eq({ namespace_id: 1, plan_name: 'Ultimate', action: 'reactivate' }) }
end
end end
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