Commit 586e5584 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Rename Namespace.can_extend? to Namespace.can_extend_trial?

parent ae94bd46
......@@ -150,7 +150,7 @@ class TrialsController < ApplicationController
return false unless GitlabSubscription.trial_extension_types.value?(trial_extension_type)
return false if trial_extension_type == GitlabSubscription.trial_extension_types[:extended] && !@namespace.can_extend?
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?
......
......@@ -302,7 +302,7 @@ module EE
trial? && trial_ends_on.present? && trial_ends_on >= Date.today
end
def can_extend?
def can_extend_trial?
trial_active? && !trial_extended_or_reactivated?
end
......
......@@ -1229,10 +1229,10 @@ RSpec.describe Namespace do
end
end
describe '#can_extend?' do
subject { namespace.can_extend? }
describe '#can_extend_trial?' do
subject { namespace.can_extend_trial? }
where(:trial_active, :trial_extended_or_reactivated, :can_extend) do
where(:trial_active, :trial_extended_or_reactivated, :can_extend_trial) do
false | false | false
false | true | false
true | false | true
......@@ -1245,7 +1245,7 @@ RSpec.describe Namespace do
allow(namespace).to receive(:trial_extended_or_reactivated?).and_return(trial_extended_or_reactivated)
end
it { is_expected.to be can_extend }
it { is_expected.to be can_extend_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