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
2f53c2d6
Commit
2f53c2d6
authored
Jul 13, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Namespace.can_reactivate? to Namespace.can_reactivate_trial?
parent
586e5584
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 @
2f53c2d6
...
...
@@ -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
...
...
ee/app/models/ee/namespace.rb
View file @
2f53c2d6
...
...
@@ -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
...
...
ee/spec/models/ee/namespace_spec.rb
View file @
2f53c2d6
...
...
@@ -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
...
...
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