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
5e7b2f71
Commit
5e7b2f71
authored
Sep 28, 2021
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviews and suggestions
parent
c008db06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
10 deletions
+30
-10
ee/app/views/shared/_old_repository_size_limit_setting.html.haml
...views/shared/_old_repository_size_limit_setting.html.haml
+1
-1
ee/spec/lib/ee/gitlab/ip_restriction/enforcer_spec.rb
ee/spec/lib/ee/gitlab/ip_restriction/enforcer_spec.rb
+12
-3
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+17
-6
No files found.
ee/app/views/shared/_old_repository_size_limit_setting.html.haml
View file @
5e7b2f71
-
return
unless
current_user
.
admin?
&&
License
.
feature_available?
(
:repository_size_limit
)
-
return
unless
current_user
.
admin?
&&
License
.
feature_available?
(
:repository_size_limit
)
||
License
.
features_with_usage_ping
.
include?
(
:repository_size_limit
)
-
form
=
local_assigns
.
fetch
(
:form
)
-
type
=
local_assigns
.
fetch
(
:type
)
...
...
ee/spec/lib/ee/gitlab/ip_restriction/enforcer_spec.rb
View file @
5e7b2f71
...
...
@@ -42,7 +42,7 @@ RSpec.describe Gitlab::IpRestriction::Enforcer do
it_behaves_like
'ip_restriction'
context
'feature is disabled'
do
context
'
group_ip_restriction
feature is disabled'
do
before
do
stub_licensed_features
(
group_ip_restriction:
false
)
end
...
...
@@ -56,7 +56,7 @@ RSpec.describe Gitlab::IpRestriction::Enforcer do
stub_application_setting
(
usage_ping_enabled:
true
)
end
context
'when usage_ping_features_enabled is
activat
ed'
do
context
'when usage_ping_features_enabled is
enabl
ed'
do
before
do
stub_application_setting
(
usage_ping_features_enabled:
true
)
end
...
...
@@ -64,7 +64,7 @@ RSpec.describe Gitlab::IpRestriction::Enforcer do
it_behaves_like
'ip_restriction'
end
context
'when usage_ping_features_enabled is d
eactivat
ed'
do
context
'when usage_ping_features_enabled is d
isabl
ed'
do
before
do
stub_application_setting
(
usage_ping_features_enabled:
false
)
end
...
...
@@ -72,5 +72,14 @@ RSpec.describe Gitlab::IpRestriction::Enforcer do
it
{
is_expected
.
to
be_truthy
}
end
end
context
'when usage ping is disabled'
do
before
do
stub_licensed_features
(
group_ip_restriction:
false
)
stub_application_setting
(
usage_ping_enabled:
false
)
end
it
{
is_expected
.
to
be_truthy
}
end
end
end
ee/spec/models/project_spec.rb
View file @
5e7b2f71
...
...
@@ -2363,7 +2363,7 @@ RSpec.describe Project do
stub_licensed_features
(
repository_size_limit:
true
)
end
it
'is enabled'
do
it
'
size limit
is enabled'
do
expect
(
checker
.
enabled?
).
to
be_truthy
end
end
...
...
@@ -2373,7 +2373,7 @@ RSpec.describe Project do
stub_licensed_features
(
repository_size_limit:
false
)
end
it
'is disabled'
do
it
'
size limit
is disabled'
do
expect
(
checker
.
enabled?
).
to
be_falsey
end
end
...
...
@@ -2384,26 +2384,37 @@ RSpec.describe Project do
stub_application_setting
(
usage_ping_enabled:
true
)
end
context
'when
feature
is activated'
do
context
'when
usage_ping_features
is activated'
do
before
do
stub_application_setting
(
usage_ping_features_enabled:
true
)
end
it
'is enabled'
do
it
'
size limit
is enabled'
do
expect
(
checker
.
enabled?
).
to
be_truthy
end
end
context
'when
feature is deactivat
ed'
do
context
'when
usage_ping_features is disabl
ed'
do
before
do
stub_application_setting
(
usage_ping_features_enabled:
false
)
end
it
'is disabled'
do
it
'
size limit
is disabled'
do
expect
(
checker
.
enabled?
).
to
be_falsy
end
end
end
context
'when usage ping is disabled'
do
before
do
stub_licensed_features
(
repository_size_limit:
false
)
stub_application_setting
(
usage_ping_enabled:
false
)
end
it
'size limit is disabled'
do
expect
(
checker
.
enabled?
).
to
be_falsey
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