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
8b832ed3
Commit
8b832ed3
authored
Aug 03, 2021
by
Angelo Gulina
Committed by
Robert Speicher
Aug 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CI Minutes] Link to new CI Minutes purchase route
parent
4e282783
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
3 deletions
+49
-3
ee/app/helpers/ee/namespaces_helper.rb
ee/app/helpers/ee/namespaces_helper.rb
+6
-0
ee/app/views/namespaces/pipelines_quota/_list.haml
ee/app/views/namespaces/pipelines_quota/_list.haml
+1
-1
ee/spec/features/groups/usage_quotas_spec.rb
ee/spec/features/groups/usage_quotas_spec.rb
+22
-2
ee/spec/helpers/ee/namespaces_helper_spec.rb
ee/spec/helpers/ee/namespaces_helper_spec.rb
+20
-0
No files found.
ee/app/helpers/ee/namespaces_helper.rb
View file @
8b832ed3
...
@@ -38,5 +38,11 @@ module EE
...
@@ -38,5 +38,11 @@ module EE
current_user
.
can?
(
:admin_namespace
,
namespace
.
root_ancestor
)
current_user
.
can?
(
:admin_namespace
,
namespace
.
root_ancestor
)
end
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
)
buy_minutes_subscriptions_path
(
selected_group:
namespace
.
id
)
end
end
end
end
end
ee/app/views/namespaces/pipelines_quota/_list.haml
View file @
8b832ed3
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
.col-sm-6.offset-sm-6
.col-sm-6.offset-sm-6
-
if
::
Gitlab
.
com?
-
if
::
Gitlab
.
com?
=
link_to
s_
(
'UsageQuota|Buy additional minutes'
),
=
link_to
s_
(
'UsageQuota|Buy additional minutes'
),
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
,
link_to_buy_additional_minutes_path
(
namespace
)
,
target:
'_blank'
,
target:
'_blank'
,
class:
'gl-button btn btn-confirm float-right'
,
class:
'gl-button btn btn-confirm float-right'
,
data:
{
track_event:
'click_buy_ci_minutes'
,
track_label:
namespace
.
actual_plan_name
,
track_property:
'pipeline_quota_page'
}
data:
{
track_event:
'click_buy_ci_minutes'
,
track_label:
namespace
.
actual_plan_name
,
track_property:
'pipeline_quota_page'
}
...
...
ee/spec/features/groups/usage_quotas_spec.rb
View file @
8b832ed3
...
@@ -144,8 +144,6 @@ RSpec.describe 'Groups > Usage Quotas' do
...
@@ -144,8 +144,6 @@ RSpec.describe 'Groups > Usage Quotas' do
it
'has correct tracking setup and shows correct group quota and projects info'
do
it
'has correct tracking setup and shows correct group quota and projects info'
do
visit_pipeline_quota_page
visit_pipeline_quota_page
expect
(
page
).
to
have_link
(
'Buy additional minutes'
,
href:
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
)
page
.
within
(
'.pipeline-quota'
)
do
page
.
within
(
'.pipeline-quota'
)
do
expect
(
page
).
to
have_content
(
"1000 / 500 minutes"
)
expect
(
page
).
to
have_content
(
"1000 / 500 minutes"
)
expect
(
page
).
to
have_content
(
"200% used"
)
expect
(
page
).
to
have_content
(
"200% used"
)
...
@@ -188,6 +186,28 @@ RSpec.describe 'Groups > Usage Quotas' do
...
@@ -188,6 +186,28 @@ RSpec.describe 'Groups > Usage Quotas' do
end
end
end
end
describe
'new_route_ci_minutes_purchase feature flag'
do
context
'when is disabled'
do
before
do
stub_feature_flags
(
new_route_ci_minutes_purchase:
false
)
end
it
'points to Customers Portal purchase flow'
do
visit_pipeline_quota_page
expect
(
page
).
to
have_link
(
'Buy additional minutes'
,
href:
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
)
end
end
context
'when is enabled'
do
it
'points to GitLab purchase flow'
do
visit_pipeline_quota_page
expect
(
page
).
to
have_link
(
'Buy additional minutes'
,
href:
buy_minutes_subscriptions_path
(
selected_group:
group
.
id
))
end
end
end
def
visit_pipeline_quota_page
def
visit_pipeline_quota_page
visit
group_usage_quotas_path
(
group
)
visit
group_usage_quotas_path
(
group
)
end
end
...
...
ee/spec/helpers/ee/namespaces_helper_spec.rb
View file @
8b832ed3
...
@@ -172,4 +172,24 @@ RSpec.describe EE::NamespacesHelper do
...
@@ -172,4 +172,24 @@ RSpec.describe EE::NamespacesHelper do
end
end
end
end
end
end
describe
'#link_to_buy_additional_minutes_path'
do
subject
{
helper
.
link_to_buy_additional_minutes_path
(
namespace
)
}
let_it_be
(
:namespace
)
{
create
(
:namespace_with_plan
)
}
context
'new_route_ci_minutes_purchase'
do
context
'when is disabled'
do
before
do
stub_feature_flags
(
new_route_ci_minutes_purchase:
false
)
end
it
{
is_expected
.
to
be
EE
::
SUBSCRIPTIONS_MORE_MINUTES_URL
}
end
context
'when is enabled'
do
it
{
is_expected
.
to
eq
buy_minutes_subscriptions_path
(
selected_group:
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