Commit 5e7b2f71 authored by Rajendra Kadam's avatar Rajendra Kadam

Apply reviews and suggestions

parent c008db06
- 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)
......
......@@ -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 activated' do
context 'when usage_ping_features_enabled is enabled' 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 deactivated' do
context 'when usage_ping_features_enabled is disabled' 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
......@@ -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 deactivated' do
context 'when usage_ping_features is disabled' 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment