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
3d637bf0
Commit
3d637bf0
authored
Aug 20, 2021
by
Diana Zubova
Committed by
Bob Van Landuyt
Aug 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reroute CI Minutes purchase for personal namespace
parent
0d365ec3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
ee/app/helpers/ee/namespaces_helper.rb
ee/app/helpers/ee/namespaces_helper.rb
+2
-1
ee/spec/helpers/ee/namespaces_helper_spec.rb
ee/spec/helpers/ee/namespaces_helper_spec.rb
+12
-3
No files found.
ee/app/helpers/ee/namespaces_helper.rb
View file @
3d637bf0
...
@@ -40,7 +40,8 @@ module EE
...
@@ -40,7 +40,8 @@ module EE
end
end
def
link_to_buy_additional_minutes_path
(
namespace
)
def
link_to_buy_additional_minutes_path
(
namespace
)
return
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
if
::
Feature
.
disabled?
(
:new_route_ci_minutes_purchase
,
namespace
,
default_enabled: :yaml
)
use_customer_dot_path
=
namespace
.
user?
||
::
Feature
.
disabled?
(
:new_route_ci_minutes_purchase
,
namespace
,
default_enabled: :yaml
)
return
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
if
use_customer_dot_path
buy_minutes_subscriptions_path
(
selected_group:
namespace
.
id
)
buy_minutes_subscriptions_path
(
selected_group:
namespace
.
id
)
end
end
...
...
ee/spec/helpers/ee/namespaces_helper_spec.rb
View file @
3d637bf0
...
@@ -177,7 +177,7 @@ RSpec.describe EE::NamespacesHelper do
...
@@ -177,7 +177,7 @@ RSpec.describe EE::NamespacesHelper do
describe
'#link_to_buy_additional_minutes_path'
do
describe
'#link_to_buy_additional_minutes_path'
do
subject
{
helper
.
link_to_buy_additional_minutes_path
(
namespace
)
}
subject
{
helper
.
link_to_buy_additional_minutes_path
(
namespace
)
}
let_it_be
(
:namespace
)
{
create
(
:
namespace_with_plan
)
}
let_it_be
(
:namespace
)
{
create
(
:
group
)
}
context
'new_route_ci_minutes_purchase'
do
context
'new_route_ci_minutes_purchase'
do
context
'when is disabled'
do
context
'when is disabled'
do
...
@@ -193,8 +193,8 @@ RSpec.describe EE::NamespacesHelper do
...
@@ -193,8 +193,8 @@ RSpec.describe EE::NamespacesHelper do
end
end
context
'when is enabled only for a specific namespace'
do
context
'when is enabled only for a specific namespace'
do
let_it_be
(
:enabled_namespace
)
{
create
(
:
namespace_with_plan
)
}
let_it_be
(
:enabled_namespace
)
{
create
(
:
group
)
}
let_it_be
(
:disabled_namespace
)
{
create
(
:
namespace_with_plan
)
}
let_it_be
(
:disabled_namespace
)
{
create
(
:
group
)
}
before
do
before
do
stub_feature_flags
(
new_route_ci_minutes_purchase:
false
)
stub_feature_flags
(
new_route_ci_minutes_purchase:
false
)
...
@@ -209,6 +209,15 @@ RSpec.describe EE::NamespacesHelper do
...
@@ -209,6 +209,15 @@ RSpec.describe EE::NamespacesHelper do
expect
(
helper
.
link_to_buy_additional_minutes_path
(
enabled_namespace
)).
to
eq
buy_minutes_subscriptions_path
(
selected_group:
enabled_namespace
.
id
)
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
context
'when called for a personal namespace'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:personal_namespace
)
{
user
.
namespace
}
it
'returns the default purchase'
do
expect
(
helper
.
link_to_buy_additional_minutes_path
(
personal_namespace
)).
to
be
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
end
end
end
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