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
c5db2d49
Commit
c5db2d49
authored
Aug 05, 2021
by
Angelo Gulina
Committed by
David Kim
Aug 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Ci Minutes] [Feature flag] Add support for group actors
parent
1e4d2527
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
4 deletions
+23
-4
ee/app/controllers/subscriptions_controller.rb
ee/app/controllers/subscriptions_controller.rb
+2
-2
ee/app/helpers/ee/namespaces_helper.rb
ee/app/helpers/ee/namespaces_helper.rb
+1
-1
ee/spec/controllers/subscriptions_controller_spec.rb
ee/spec/controllers/subscriptions_controller_spec.rb
+2
-1
ee/spec/helpers/ee/namespaces_helper_spec.rb
ee/spec/helpers/ee/namespaces_helper_spec.rb
+18
-0
No files found.
ee/app/controllers/subscriptions_controller.rb
View file @
c5db2d49
...
...
@@ -32,11 +32,11 @@ class SubscriptionsController < ApplicationController
end
def
buy_minutes
return
render_404
unless
Feature
.
enabled?
(
:new_route_ci_minutes_purchase
,
default_enabled: :yaml
)
@group
=
find_group
return
render_404
if
@group
.
nil?
render_404
unless
Feature
.
enabled?
(
:new_route_ci_minutes_purchase
,
@group
,
default_enabled: :yaml
)
end
def
payment_form
...
...
ee/app/helpers/ee/namespaces_helper.rb
View file @
c5db2d49
...
...
@@ -40,7 +40,7 @@ module EE
end
def
link_to_buy_additional_minutes_path
(
namespace
)
return
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
if
::
Feature
.
disabled?
(
:new_route_ci_minutes_purchase
,
default_enabled: :yaml
)
return
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
if
::
Feature
.
disabled?
(
:new_route_ci_minutes_purchase
,
namespace
,
default_enabled: :yaml
)
buy_minutes_subscriptions_path
(
selected_group:
namespace
.
id
)
end
...
...
ee/spec/controllers/subscriptions_controller_spec.rb
View file @
c5db2d49
...
...
@@ -72,7 +72,8 @@ RSpec.describe SubscriptionsController do
context
'with authenticated user'
do
before
do
group
.
add_owner
(
user
)
stub_feature_flags
(
new_route_ci_minutes_purchase:
true
)
stub_feature_flags
(
new_route_ci_minutes_purchase:
false
)
stub_feature_flags
(
new_route_ci_minutes_purchase:
group
)
sign_in
(
user
)
end
...
...
ee/spec/helpers/ee/namespaces_helper_spec.rb
View file @
c5db2d49
...
...
@@ -190,6 +190,24 @@ RSpec.describe EE::NamespacesHelper do
context
'when is enabled'
do
it
{
is_expected
.
to
eq
buy_minutes_subscriptions_path
(
selected_group:
namespace
.
id
)
}
end
context
'when is enabled only for a specific namespace'
do
let_it_be
(
:enabled_namespace
)
{
create
(
:namespace_with_plan
)
}
let_it_be
(
:disabled_namespace
)
{
create
(
:namespace_with_plan
)
}
before
do
stub_feature_flags
(
new_route_ci_minutes_purchase:
false
)
stub_feature_flags
(
new_route_ci_minutes_purchase:
enabled_namespace
)
end
it
'returns the default purchase path for the disabled namespace'
do
expect
(
helper
.
link_to_buy_additional_minutes_path
(
disabled_namespace
)).
to
be
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
end
it
'returns GitLab purchase path for the disabled namespace'
do
expect
(
helper
.
link_to_buy_additional_minutes_path
(
enabled_namespace
)).
to
eq
buy_minutes_subscriptions_path
(
selected_group:
enabled_namespace
.
id
)
end
end
end
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