Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
586e5584
Commit
586e5584
authored
Jul 13, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Namespace.can_extend? to Namespace.can_extend_trial?
parent
ae94bd46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
ee/app/controllers/trials_controller.rb
ee/app/controllers/trials_controller.rb
+1
-1
ee/app/models/ee/namespace.rb
ee/app/models/ee/namespace.rb
+1
-1
ee/spec/models/ee/namespace_spec.rb
ee/spec/models/ee/namespace_spec.rb
+4
-4
No files found.
ee/app/controllers/trials_controller.rb
View file @
586e5584
...
...
@@ -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?
...
...
ee/app/models/ee/namespace.rb
View file @
586e5584
...
...
@@ -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
...
...
ee/spec/models/ee/namespace_spec.rb
View file @
586e5584
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment