Commit 2f53c2d6 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Rename Namespace.can_reactivate? to Namespace.can_reactivate_trial?

parent 586e5584
......@@ -152,7 +152,7 @@ class TrialsController < ApplicationController
return false if trial_extension_type == GitlabSubscription.trial_extension_types[:extended] && !@namespace.can_extend_trial?
return false if trial_extension_type == GitlabSubscription.trial_extension_types[:reactivated] && !@namespace.can_reactivate?
return false if trial_extension_type == GitlabSubscription.trial_extension_types[:reactivated] && !@namespace.can_reactivate_trial?
true
end
......
......@@ -306,7 +306,7 @@ module EE
trial_active? && !trial_extended_or_reactivated?
end
def can_reactivate?
def can_reactivate_trial?
!trial_active? && !never_had_trial? && !trial_extended_or_reactivated? && free_plan?
end
......
......@@ -1249,10 +1249,10 @@ RSpec.describe Namespace do
end
end
describe '#can_reactivate?' do
subject { namespace.can_reactivate? }
describe '#can_reactivate_trial?' do
subject { namespace.can_reactivate_trial? }
where(:trial_active, :never_had_trial, :trial_extended_or_reactivated, :free_plan, :can_reactivate) do
where(:trial_active, :never_had_trial, :trial_extended_or_reactivated, :free_plan, :can_reactivate_trial) do
false | false | false | false | false
false | false | false | true | true
false | false | true | false | false
......@@ -1279,7 +1279,7 @@ RSpec.describe Namespace do
allow(namespace).to receive(:free_plan?).and_return(free_plan)
end
it { is_expected.to be can_reactivate }
it { is_expected.to be can_reactivate_trial }
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