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
fd7fbb27
Commit
fd7fbb27
authored
Nov 03, 2020
by
Ragnar Hardarson
Committed by
Vitaly Slobodin
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use purchase helper for automatic storage
parent
abd6f3ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
3 deletions
+34
-3
ee/app/views/groups/usage_quotas/index.html.haml
ee/app/views/groups/usage_quotas/index.html.haml
+1
-1
ee/app/views/profiles/usage_quotas/index.html.haml
ee/app/views/profiles/usage_quotas/index.html.haml
+1
-1
ee/spec/controllers/projects_controller_spec.rb
ee/spec/controllers/projects_controller_spec.rb
+32
-1
No files found.
ee/app/views/groups/usage_quotas/index.html.haml
View file @
fd7fbb27
-
page_title
s_
(
"UsageQuota|Usage"
)
-
url_to_purchase_storage
=
purchase_storage_url
if
can_purchase_storage
?
-
url_to_purchase_storage
=
purchase_storage_url
if
can_purchase_storage
_for_namespace?
(
@group
)
%h3
.page-title
=
s_
(
'UsageQuota|Usage Quotas'
)
...
...
ee/app/views/profiles/usage_quotas/index.html.haml
View file @
fd7fbb27
-
page_title
s_
(
"UsageQuota|Usage"
)
-
@content_class
=
"limit-container-width"
unless
fluid_layout
-
url_to_purchase_storage
=
purchase_storage_url
if
can_purchase_storage
?
-
url_to_purchase_storage
=
purchase_storage_url
if
can_purchase_storage
_for_namespace?
(
@namespace
)
%h3
.page-title
=
s_
(
'UsageQuota|Usage Quotas'
)
...
...
ee/spec/controllers/projects_controller_spec.rb
View file @
fd7fbb27
...
...
@@ -8,7 +8,7 @@ RSpec.describe ProjectsController do
let
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:public_project
)
{
create
(
:project
,
:public
,
:repository
)
}
let_it_be
(
:public_project
)
{
create
(
:project
,
:public
,
:repository
,
namespace:
group
)
}
before
do
project
.
add_maintainer
(
user
)
...
...
@@ -20,6 +20,37 @@ RSpec.describe ProjectsController do
subject
{
get
:show
,
params:
{
namespace_id:
public_project
.
namespace
.
path
,
id:
public_project
.
path
}
}
context
'additional repo storage by namespace'
do
using
RSpec
::
Parameterized
::
TableSyntax
let
(
:namespace
)
{
public_project
.
namespace
}
where
(
:automatic_purchased_storage_allocation
,
:additional_repo_storage_by_namespace
,
:expected_to_render
)
do
true
|
true
|
true
true
|
false
|
false
false
|
true
|
false
false
|
false
|
false
end
with_them
do
before
do
allow_next_instance_of
(
EE
::
Namespace
::
RootExcessStorageSize
)
do
|
root_storage
|
allow
(
root_storage
).
to
receive
(
:usage_ratio
).
and_return
(
0.5
)
allow
(
root_storage
).
to
receive
(
:above_size_limit?
).
and_return
(
true
)
end
stub_application_setting
(
automatic_purchased_storage_allocation:
automatic_purchased_storage_allocation
)
stub_feature_flags
(
additional_repo_storage_by_namespace:
additional_repo_storage_by_namespace
,
namespace_storage_limit:
false
)
namespace
.
add_owner
(
user
)
end
it
do
subject
expect
(
response
.
body
.
include?
(
"Please purchase additional storage"
)).
to
eq
(
expected_to_render
)
end
end
end
context
'with additional_repo_storage_by_namespace_enabled? enabled'
do
before
do
allow_any_instance_of
(
EE
::
Namespace
).
to
receive
(
:additional_repo_storage_by_namespace_enabled?
).
and_return
(
true
)
...
...
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