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
2b66d57d
Commit
2b66d57d
authored
Jan 28, 2021
by
Allison Browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete extra `using` references
Only mention `using RSpec::Parameterized::TableSyntax` once per file.
parent
3de8d8b0
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
14 additions
and
101 deletions
+14
-101
ee/spec/controllers/ee/groups_controller_spec.rb
ee/spec/controllers/ee/groups_controller_spec.rb
+1
-6
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+0
-4
spec/lib/gitlab/access/branch_protection_spec.rb
spec/lib/gitlab/access/branch_protection_spec.rb
+2
-8
spec/lib/gitlab/ci/config/entry/cache_spec.rb
spec/lib/gitlab/ci/config/entry/cache_spec.rb
+2
-8
spec/lib/gitlab/search_results_spec.rb
spec/lib/gitlab/search_results_spec.rb
+1
-6
spec/lib/gitlab/utils_spec.rb
spec/lib/gitlab/utils_spec.rb
+0
-8
spec/models/concerns/issuable_spec.rb
spec/models/concerns/issuable_spec.rb
+1
-10
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+0
-6
spec/models/project_spec.rb
spec/models/project_spec.rb
+0
-9
spec/models/prometheus_metric_spec.rb
spec/models/prometheus_metric_spec.rb
+2
-8
spec/requests/api/generic_packages_spec.rb
spec/requests/api/generic_packages_spec.rb
+1
-10
spec/requests/api/pypi_packages_spec.rb
spec/requests/api/pypi_packages_spec.rb
+1
-8
spec/services/projects/prometheus/alerts/notify_service_spec.rb
...ervices/projects/prometheus/alerts/notify_service_spec.rb
+1
-6
spec/services/users/build_service_spec.rb
spec/services/users/build_service_spec.rb
+2
-4
No files found.
ee/spec/controllers/ee/groups_controller_spec.rb
View file @
2b66d57d
...
@@ -4,6 +4,7 @@ require 'spec_helper'
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
GroupsController
do
RSpec
.
describe
GroupsController
do
include
ExternalAuthorizationServiceHelpers
include
ExternalAuthorizationServiceHelpers
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:group
)
{
create
(
:group
,
:public
)
}
...
@@ -277,8 +278,6 @@ RSpec.describe GroupsController do
...
@@ -277,8 +278,6 @@ RSpec.describe GroupsController do
end
end
context
'when creating a group with `default_branch_protection` attribute'
do
context
'when creating a group with `default_branch_protection` attribute'
do
using
RSpec
::
Parameterized
::
TableSyntax
subject
do
subject
do
post
:create
,
params:
{
group:
group_params
.
merge
(
default_branch_protection:
Gitlab
::
Access
::
PROTECTION_NONE
)
}
post
:create
,
params:
{
group:
group_params
.
merge
(
default_branch_protection:
Gitlab
::
Access
::
PROTECTION_NONE
)
}
end
end
...
@@ -456,8 +455,6 @@ RSpec.describe GroupsController do
...
@@ -456,8 +455,6 @@ RSpec.describe GroupsController do
end
end
context
'when `default_branch_protection` is specified'
do
context
'when `default_branch_protection` is specified'
do
using
RSpec
::
Parameterized
::
TableSyntax
let
(
:params
)
do
let
(
:params
)
do
{
id:
group
.
to_param
,
group:
{
default_branch_protection:
Gitlab
::
Access
::
PROTECTION_NONE
}
}
{
id:
group
.
to_param
,
group:
{
default_branch_protection:
Gitlab
::
Access
::
PROTECTION_NONE
}
}
end
end
...
@@ -555,8 +552,6 @@ RSpec.describe GroupsController do
...
@@ -555,8 +552,6 @@ RSpec.describe GroupsController do
end
end
context
'when `prevent_forking_outside_group` is specified'
do
context
'when `prevent_forking_outside_group` is specified'
do
using
RSpec
::
Parameterized
::
TableSyntax
subject
{
put
:update
,
params:
params
}
subject
{
put
:update
,
params:
params
}
shared_examples_for
'updates the attribute if needed'
do
shared_examples_for
'updates the attribute if needed'
do
...
...
ee/spec/models/project_spec.rb
View file @
2b66d57d
...
@@ -2257,8 +2257,6 @@ RSpec.describe Project do
...
@@ -2257,8 +2257,6 @@ RSpec.describe Project do
end
end
describe
'#repository_size_excess'
do
describe
'#repository_size_excess'
do
using
RSpec
::
Parameterized
::
TableSyntax
subject
{
project
.
repository_size_excess
}
subject
{
project
.
repository_size_excess
}
let_it_be
(
:statistics
)
{
create
(
:project_statistics
)
}
let_it_be
(
:statistics
)
{
create
(
:project_statistics
)
}
...
@@ -2491,8 +2489,6 @@ RSpec.describe Project do
...
@@ -2491,8 +2489,6 @@ RSpec.describe Project do
end
end
describe
'#adjourned_deletion?'
do
describe
'#adjourned_deletion?'
do
using
RSpec
::
Parameterized
::
TableSyntax
subject
{
project
.
adjourned_deletion?
}
subject
{
project
.
adjourned_deletion?
}
where
(
:licensed?
,
:feature_enabled_on_group?
,
:adjourned_period
,
:result
)
do
where
(
:licensed?
,
:feature_enabled_on_group?
,
:adjourned_period
,
:result
)
do
...
...
spec/lib/gitlab/access/branch_protection_spec.rb
View file @
2b66d57d
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Access
::
BranchProtection
do
RSpec
.
describe
Gitlab
::
Access
::
BranchProtection
do
describe
'#any?'
do
using
RSpec
::
Parameterized
::
TableSyntax
using
RSpec
::
Parameterized
::
TableSyntax
describe
'#any?'
do
where
(
:level
,
:result
)
do
where
(
:level
,
:result
)
do
Gitlab
::
Access
::
PROTECTION_NONE
|
false
Gitlab
::
Access
::
PROTECTION_NONE
|
false
Gitlab
::
Access
::
PROTECTION_DEV_CAN_PUSH
|
true
Gitlab
::
Access
::
PROTECTION_DEV_CAN_PUSH
|
true
...
@@ -19,8 +19,6 @@ RSpec.describe Gitlab::Access::BranchProtection do
...
@@ -19,8 +19,6 @@ RSpec.describe Gitlab::Access::BranchProtection do
end
end
describe
'#developer_can_push?'
do
describe
'#developer_can_push?'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:level
,
:result
)
do
where
(
:level
,
:result
)
do
Gitlab
::
Access
::
PROTECTION_NONE
|
false
Gitlab
::
Access
::
PROTECTION_NONE
|
false
Gitlab
::
Access
::
PROTECTION_DEV_CAN_PUSH
|
true
Gitlab
::
Access
::
PROTECTION_DEV_CAN_PUSH
|
true
...
@@ -36,8 +34,6 @@ RSpec.describe Gitlab::Access::BranchProtection do
...
@@ -36,8 +34,6 @@ RSpec.describe Gitlab::Access::BranchProtection do
end
end
describe
'#developer_can_merge?'
do
describe
'#developer_can_merge?'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:level
,
:result
)
do
where
(
:level
,
:result
)
do
Gitlab
::
Access
::
PROTECTION_NONE
|
false
Gitlab
::
Access
::
PROTECTION_NONE
|
false
Gitlab
::
Access
::
PROTECTION_DEV_CAN_PUSH
|
false
Gitlab
::
Access
::
PROTECTION_DEV_CAN_PUSH
|
false
...
@@ -53,8 +49,6 @@ RSpec.describe Gitlab::Access::BranchProtection do
...
@@ -53,8 +49,6 @@ RSpec.describe Gitlab::Access::BranchProtection do
end
end
describe
'#fully_protected?'
do
describe
'#fully_protected?'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:level
,
:result
)
do
where
(
:level
,
:result
)
do
Gitlab
::
Access
::
PROTECTION_NONE
|
false
Gitlab
::
Access
::
PROTECTION_NONE
|
false
Gitlab
::
Access
::
PROTECTION_DEV_CAN_PUSH
|
false
Gitlab
::
Access
::
PROTECTION_DEV_CAN_PUSH
|
false
...
...
spec/lib/gitlab/ci/config/entry/cache_spec.rb
View file @
2b66d57d
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
Gitlab
::
Ci
::
Config
::
Entry
::
Cache
do
RSpec
.
describe
Gitlab
::
Ci
::
Config
::
Entry
::
Cache
do
using
RSpec
::
Parameterized
::
TableSyntax
subject
(
:entry
)
{
described_class
.
new
(
config
)
}
subject
(
:entry
)
{
described_class
.
new
(
config
)
}
describe
'validations'
do
describe
'validations'
do
...
@@ -56,8 +58,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Cache do
...
@@ -56,8 +58,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Cache do
end
end
context
'with `policy`'
do
context
'with `policy`'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:policy
,
:result
)
do
where
(
:policy
,
:result
)
do
'pull-push'
|
'pull-push'
'pull-push'
|
'pull-push'
'push'
|
'push'
'push'
|
'push'
...
@@ -77,8 +77,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Cache do
...
@@ -77,8 +77,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Cache do
end
end
context
'with `when`'
do
context
'with `when`'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:when_config
,
:result
)
do
where
(
:when_config
,
:result
)
do
'on_success'
|
'on_success'
'on_success'
|
'on_success'
'on_failure'
|
'on_failure'
'on_failure'
|
'on_failure'
...
@@ -109,8 +107,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Cache do
...
@@ -109,8 +107,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Cache do
end
end
context
'with `policy`'
do
context
'with `policy`'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:policy
,
:valid
)
do
where
(
:policy
,
:valid
)
do
'pull-push'
|
true
'pull-push'
|
true
'push'
|
true
'push'
|
true
...
@@ -126,8 +122,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Cache do
...
@@ -126,8 +122,6 @@ RSpec.describe Gitlab::Ci::Config::Entry::Cache do
end
end
context
'with `when`'
do
context
'with `when`'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:when_config
,
:valid
)
do
where
(
:when_config
,
:valid
)
do
'on_success'
|
true
'on_success'
|
true
'on_failure'
|
true
'on_failure'
|
true
...
...
spec/lib/gitlab/search_results_spec.rb
View file @
2b66d57d
...
@@ -5,6 +5,7 @@ require 'spec_helper'
...
@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec
.
describe
Gitlab
::
SearchResults
do
RSpec
.
describe
Gitlab
::
SearchResults
do
include
ProjectForksHelper
include
ProjectForksHelper
include
SearchHelpers
include
SearchHelpers
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
name:
'foo'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
name:
'foo'
)
}
...
@@ -41,8 +42,6 @@ RSpec.describe Gitlab::SearchResults do
...
@@ -41,8 +42,6 @@ RSpec.describe Gitlab::SearchResults do
end
end
describe
'#formatted_count'
do
describe
'#formatted_count'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:scope
,
:count_method
,
:expected
)
do
where
(
:scope
,
:count_method
,
:expected
)
do
'projects'
|
:limited_projects_count
|
max_limited_count
'projects'
|
:limited_projects_count
|
max_limited_count
'issues'
|
:limited_issues_count
|
max_limited_count
'issues'
|
:limited_issues_count
|
max_limited_count
...
@@ -61,8 +60,6 @@ RSpec.describe Gitlab::SearchResults do
...
@@ -61,8 +60,6 @@ RSpec.describe Gitlab::SearchResults do
end
end
describe
'#highlight_map'
do
describe
'#highlight_map'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:scope
,
:expected
)
do
where
(
:scope
,
:expected
)
do
'projects'
|
{}
'projects'
|
{}
'issues'
|
{}
'issues'
|
{}
...
@@ -80,8 +77,6 @@ RSpec.describe Gitlab::SearchResults do
...
@@ -80,8 +77,6 @@ RSpec.describe Gitlab::SearchResults do
end
end
describe
'#formatted_limited_count'
do
describe
'#formatted_limited_count'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:count
,
:expected
)
do
where
(
:count
,
:expected
)
do
23
|
'23'
23
|
'23'
99
|
'99'
99
|
'99'
...
...
spec/lib/gitlab/utils_spec.rb
View file @
2b66d57d
...
@@ -116,8 +116,6 @@ RSpec.describe Gitlab::Utils do
...
@@ -116,8 +116,6 @@ RSpec.describe Gitlab::Utils do
end
end
describe
'.ms_to_round_sec'
do
describe
'.ms_to_round_sec'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:original
,
:expected
)
do
where
(
:original
,
:expected
)
do
1999.8999
|
1.9999
1999.8999
|
1.9999
12384
|
12.384
12384
|
12.384
...
@@ -169,8 +167,6 @@ RSpec.describe Gitlab::Utils do
...
@@ -169,8 +167,6 @@ RSpec.describe Gitlab::Utils do
end
end
describe
'.remove_line_breaks'
do
describe
'.remove_line_breaks'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:original
,
:expected
)
do
where
(
:original
,
:expected
)
do
"foo
\n
bar
\n
baz"
|
"foobarbaz"
"foo
\n
bar
\n
baz"
|
"foobarbaz"
"foo
\r\n
bar
\r\n
baz"
|
"foobarbaz"
"foo
\r\n
bar
\r\n
baz"
|
"foobarbaz"
...
@@ -281,8 +277,6 @@ RSpec.describe Gitlab::Utils do
...
@@ -281,8 +277,6 @@ RSpec.describe Gitlab::Utils do
end
end
describe
'.append_path'
do
describe
'.append_path'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:host
,
:path
,
:result
)
do
where
(
:host
,
:path
,
:result
)
do
'http://test/'
|
'/foo/bar'
|
'http://test/foo/bar'
'http://test/'
|
'/foo/bar'
|
'http://test/foo/bar'
'http://test/'
|
'//foo/bar'
|
'http://test/foo/bar'
'http://test/'
|
'//foo/bar'
|
'http://test/foo/bar'
...
@@ -393,8 +387,6 @@ RSpec.describe Gitlab::Utils do
...
@@ -393,8 +387,6 @@ RSpec.describe Gitlab::Utils do
end
end
describe
".safe_downcase!"
do
describe
".safe_downcase!"
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:str
,
:result
)
do
where
(
:str
,
:result
)
do
"test"
.
freeze
|
"test"
"test"
.
freeze
|
"test"
"Test"
.
freeze
|
"test"
"Test"
.
freeze
|
"test"
...
...
spec/models/concerns/issuable_spec.rb
View file @
2b66d57d
...
@@ -4,6 +4,7 @@ require 'spec_helper'
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Issuable
do
RSpec
.
describe
Issuable
do
include
ProjectForksHelper
include
ProjectForksHelper
using
RSpec
::
Parameterized
::
TableSyntax
let
(
:issuable_class
)
{
Issue
}
let
(
:issuable_class
)
{
Issue
}
let
(
:issue
)
{
create
(
:issue
,
title:
'An issue'
,
description:
'A description'
)
}
let
(
:issue
)
{
create
(
:issue
,
title:
'An issue'
,
description:
'A description'
)
}
...
@@ -820,8 +821,6 @@ RSpec.describe Issuable do
...
@@ -820,8 +821,6 @@ RSpec.describe Issuable do
end
end
describe
'#supports_time_tracking?'
do
describe
'#supports_time_tracking?'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:issuable_type
,
:supports_time_tracking
)
do
where
(
:issuable_type
,
:supports_time_tracking
)
do
:issue
|
true
:issue
|
true
:incident
|
true
:incident
|
true
...
@@ -838,8 +837,6 @@ RSpec.describe Issuable do
...
@@ -838,8 +837,6 @@ RSpec.describe Issuable do
end
end
describe
'#supports_severity?'
do
describe
'#supports_severity?'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:issuable_type
,
:supports_severity
)
do
where
(
:issuable_type
,
:supports_severity
)
do
:issue
|
false
:issue
|
false
:incident
|
true
:incident
|
true
...
@@ -856,8 +853,6 @@ RSpec.describe Issuable do
...
@@ -856,8 +853,6 @@ RSpec.describe Issuable do
end
end
describe
'#incident?'
do
describe
'#incident?'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:issuable_type
,
:incident
)
do
where
(
:issuable_type
,
:incident
)
do
:issue
|
false
:issue
|
false
:incident
|
true
:incident
|
true
...
@@ -874,8 +869,6 @@ RSpec.describe Issuable do
...
@@ -874,8 +869,6 @@ RSpec.describe Issuable do
end
end
describe
'#supports_issue_type?'
do
describe
'#supports_issue_type?'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:issuable_type
,
:supports_issue_type
)
do
where
(
:issuable_type
,
:supports_issue_type
)
do
:issue
|
true
:issue
|
true
:merge_request
|
false
:merge_request
|
false
...
@@ -894,8 +887,6 @@ RSpec.describe Issuable do
...
@@ -894,8 +887,6 @@ RSpec.describe Issuable do
subject
{
issuable
.
severity
}
subject
{
issuable
.
severity
}
context
'when issuable is not an incident'
do
context
'when issuable is not an incident'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:issuable_type
,
:severity
)
do
where
(
:issuable_type
,
:severity
)
do
:issue
|
'unknown'
:issue
|
'unknown'
:merge_request
|
'unknown'
:merge_request
|
'unknown'
...
...
spec/models/merge_request_spec.rb
View file @
2b66d57d
...
@@ -271,8 +271,6 @@ RSpec.describe MergeRequest, factory_default: :keep do
...
@@ -271,8 +271,6 @@ RSpec.describe MergeRequest, factory_default: :keep do
stub_feature_flags
(
stricter_mr_branch_name:
false
)
stub_feature_flags
(
stricter_mr_branch_name:
false
)
end
end
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:branch_name
,
:valid
)
do
where
(
:branch_name
,
:valid
)
do
'foo'
|
true
'foo'
|
true
'foo:bar'
|
false
'foo:bar'
|
false
...
@@ -2778,8 +2776,6 @@ RSpec.describe MergeRequest, factory_default: :keep do
...
@@ -2778,8 +2776,6 @@ RSpec.describe MergeRequest, factory_default: :keep do
end
end
context
'with skip_ci_check option'
do
context
'with skip_ci_check option'
do
using
RSpec
::
Parameterized
::
TableSyntax
before
do
before
do
allow
(
subject
).
to
receive_messages
(
check_mergeability:
nil
,
allow
(
subject
).
to
receive_messages
(
check_mergeability:
nil
,
can_be_merged?:
true
,
can_be_merged?:
true
,
...
@@ -2803,8 +2799,6 @@ RSpec.describe MergeRequest, factory_default: :keep do
...
@@ -2803,8 +2799,6 @@ RSpec.describe MergeRequest, factory_default: :keep do
end
end
context
'with skip_discussions_check option'
do
context
'with skip_discussions_check option'
do
using
RSpec
::
Parameterized
::
TableSyntax
before
do
before
do
allow
(
subject
).
to
receive_messages
(
mergeable_ci_state?:
true
,
allow
(
subject
).
to
receive_messages
(
mergeable_ci_state?:
true
,
check_mergeability:
nil
,
check_mergeability:
nil
,
...
...
spec/models/project_spec.rb
View file @
2b66d57d
...
@@ -2247,8 +2247,6 @@ RSpec.describe Project, factory_default: :keep do
...
@@ -2247,8 +2247,6 @@ RSpec.describe Project, factory_default: :keep do
end
end
describe
'#ci_config_path='
do
describe
'#ci_config_path='
do
using
RSpec
::
Parameterized
::
TableSyntax
let
(
:project
)
{
build_stubbed
(
:project
)
}
let
(
:project
)
{
build_stubbed
(
:project
)
}
where
(
:default_ci_config_path
,
:project_ci_config_path
,
:expected_ci_config_path
)
do
where
(
:default_ci_config_path
,
:project_ci_config_path
,
:expected_ci_config_path
)
do
...
@@ -3947,7 +3945,6 @@ RSpec.describe Project, factory_default: :keep do
...
@@ -3947,7 +3945,6 @@ RSpec.describe Project, factory_default: :keep do
describe
'.filter_by_feature_visibility'
do
describe
'.filter_by_feature_visibility'
do
include_context
'ProjectPolicyTable context'
include_context
'ProjectPolicyTable context'
include
ProjectHelpers
include
ProjectHelpers
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
,
project_level
,
namespace:
group
)
}
let!
(
:project
)
{
create
(
:project
,
project_level
,
namespace:
group
)
}
...
@@ -4197,8 +4194,6 @@ RSpec.describe Project, factory_default: :keep do
...
@@ -4197,8 +4194,6 @@ RSpec.describe Project, factory_default: :keep do
end
end
describe
'#git_transfer_in_progress?'
do
describe
'#git_transfer_in_progress?'
do
using
RSpec
::
Parameterized
::
TableSyntax
let
(
:project
)
{
build
(
:project
)
}
let
(
:project
)
{
build
(
:project
)
}
subject
{
project
.
git_transfer_in_progress?
}
subject
{
project
.
git_transfer_in_progress?
}
...
@@ -5822,8 +5817,6 @@ RSpec.describe Project, factory_default: :keep do
...
@@ -5822,8 +5817,6 @@ RSpec.describe Project, factory_default: :keep do
end
end
describe
'validation #changing_shared_runners_enabled_is_allowed'
do
describe
'validation #changing_shared_runners_enabled_is_allowed'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:shared_runners_setting
,
:project_shared_runners_enabled
,
:valid_record
)
do
where
(
:shared_runners_setting
,
:project_shared_runners_enabled
,
:valid_record
)
do
'enabled'
|
true
|
true
'enabled'
|
true
|
true
'enabled'
|
false
|
true
'enabled'
|
false
|
true
...
@@ -6046,8 +6039,6 @@ RSpec.describe Project, factory_default: :keep do
...
@@ -6046,8 +6039,6 @@ RSpec.describe Project, factory_default: :keep do
end
end
describe
'#closest_setting'
do
describe
'#closest_setting'
do
using
RSpec
::
Parameterized
::
TableSyntax
shared_examples_for
'fetching closest setting'
do
shared_examples_for
'fetching closest setting'
do
let!
(
:namespace
)
{
create
(
:namespace
)
}
let!
(
:namespace
)
{
create
(
:namespace
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
...
...
spec/models/prometheus_metric_spec.rb
View file @
2b66d57d
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
PrometheusMetric
do
RSpec
.
describe
PrometheusMetric
do
using
RSpec
::
Parameterized
::
TableSyntax
subject
{
build
(
:prometheus_metric
)
}
subject
{
build
(
:prometheus_metric
)
}
it_behaves_like
'having unique enum values'
it_behaves_like
'having unique enum values'
...
@@ -14,8 +16,6 @@ RSpec.describe PrometheusMetric do
...
@@ -14,8 +16,6 @@ RSpec.describe PrometheusMetric do
it
{
is_expected
.
to
validate_uniqueness_of
(
:identifier
).
scoped_to
(
:project_id
).
allow_nil
}
it
{
is_expected
.
to
validate_uniqueness_of
(
:identifier
).
scoped_to
(
:project_id
).
allow_nil
}
describe
'common metrics'
do
describe
'common metrics'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:common
,
:with_project
,
:result
)
do
where
(
:common
,
:with_project
,
:result
)
do
false
|
true
|
true
false
|
true
|
true
false
|
false
|
false
false
|
false
|
false
...
@@ -34,8 +34,6 @@ RSpec.describe PrometheusMetric do
...
@@ -34,8 +34,6 @@ RSpec.describe PrometheusMetric do
end
end
describe
'#query_series'
do
describe
'#query_series'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:legend
,
:type
)
do
where
(
:legend
,
:type
)
do
'Some other legend'
|
NilClass
'Some other legend'
|
NilClass
'Status Code'
|
Array
'Status Code'
|
Array
...
@@ -72,8 +70,6 @@ RSpec.describe PrometheusMetric do
...
@@ -72,8 +70,6 @@ RSpec.describe PrometheusMetric do
end
end
describe
'#priority'
do
describe
'#priority'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:group
,
:priority
)
do
where
(
:group
,
:priority
)
do
:nginx_ingress_vts
|
10
:nginx_ingress_vts
|
10
:nginx_ingress
|
10
:nginx_ingress
|
10
...
@@ -97,8 +93,6 @@ RSpec.describe PrometheusMetric do
...
@@ -97,8 +93,6 @@ RSpec.describe PrometheusMetric do
end
end
describe
'#required_metrics'
do
describe
'#required_metrics'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:group
,
:required_metrics
)
do
where
(
:group
,
:required_metrics
)
do
:nginx_ingress_vts
|
%w(nginx_upstream_responses_total nginx_upstream_response_msecs_avg)
:nginx_ingress_vts
|
%w(nginx_upstream_responses_total nginx_upstream_response_msecs_avg)
:nginx_ingress
|
%w(nginx_ingress_controller_requests nginx_ingress_controller_ingress_upstream_latency_seconds_sum)
:nginx_ingress
|
%w(nginx_ingress_controller_requests nginx_ingress_controller_ingress_upstream_latency_seconds_sum)
...
...
spec/requests/api/generic_packages_spec.rb
View file @
2b66d57d
...
@@ -4,6 +4,7 @@ require 'spec_helper'
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
API
::
GenericPackages
do
RSpec
.
describe
API
::
GenericPackages
do
include
HttpBasicAuthHelpers
include
HttpBasicAuthHelpers
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:personal_access_token
)
{
create
(
:personal_access_token
)
}
let_it_be
(
:personal_access_token
)
{
create
(
:personal_access_token
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
...
@@ -76,8 +77,6 @@ RSpec.describe API::GenericPackages do
...
@@ -76,8 +77,6 @@ RSpec.describe API::GenericPackages do
describe
'PUT /api/v4/projects/:id/packages/generic/:package_name/:package_version/:file_name/authorize'
do
describe
'PUT /api/v4/projects/:id/packages/generic/:package_name/:package_version/:file_name/authorize'
do
context
'with valid project'
do
context
'with valid project'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:project_visibility
,
:user_role
,
:member?
,
:authenticate_with
,
:expected_status
)
do
where
(
:project_visibility
,
:user_role
,
:member?
,
:authenticate_with
,
:expected_status
)
do
'PUBLIC'
|
:developer
|
true
|
:personal_access_token
|
:success
'PUBLIC'
|
:developer
|
true
|
:personal_access_token
|
:success
'PUBLIC'
|
:guest
|
true
|
:personal_access_token
|
:forbidden
'PUBLIC'
|
:guest
|
true
|
:personal_access_token
|
:forbidden
...
@@ -194,8 +193,6 @@ RSpec.describe API::GenericPackages do
...
@@ -194,8 +193,6 @@ RSpec.describe API::GenericPackages do
let
(
:params
)
{
{
file:
file_upload
}
}
let
(
:params
)
{
{
file:
file_upload
}
}
context
'authentication'
do
context
'authentication'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:project_visibility
,
:user_role
,
:member?
,
:authenticate_with
,
:expected_status
)
do
where
(
:project_visibility
,
:user_role
,
:member?
,
:authenticate_with
,
:expected_status
)
do
'PUBLIC'
|
:guest
|
true
|
:personal_access_token
|
:forbidden
'PUBLIC'
|
:guest
|
true
|
:personal_access_token
|
:forbidden
'PUBLIC'
|
:guest
|
true
|
:user_basic_auth
|
:forbidden
'PUBLIC'
|
:guest
|
true
|
:user_basic_auth
|
:forbidden
...
@@ -373,8 +370,6 @@ RSpec.describe API::GenericPackages do
...
@@ -373,8 +370,6 @@ RSpec.describe API::GenericPackages do
end
end
context
'application security'
do
context
'application security'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:param_name
,
:param_value
)
do
where
(
:param_name
,
:param_value
)
do
:package_name
|
'my-package/../'
:package_name
|
'my-package/../'
:package_name
|
'my-package%2f%2e%2e%2f'
:package_name
|
'my-package%2f%2e%2e%2f'
...
@@ -404,8 +399,6 @@ RSpec.describe API::GenericPackages do
...
@@ -404,8 +399,6 @@ RSpec.describe API::GenericPackages do
end
end
describe
'GET /api/v4/projects/:id/packages/generic/:package_name/:package_version/:file_name'
do
describe
'GET /api/v4/projects/:id/packages/generic/:package_name/:package_version/:file_name'
do
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:package
)
{
create
(
:generic_package
,
project:
project
)
}
let_it_be
(
:package
)
{
create
(
:generic_package
,
project:
project
)
}
let_it_be
(
:package_file
)
{
create
(
:package_file
,
:generic
,
package:
package
)
}
let_it_be
(
:package_file
)
{
create
(
:package_file
,
:generic
,
package:
package
)
}
...
@@ -527,8 +520,6 @@ RSpec.describe API::GenericPackages do
...
@@ -527,8 +520,6 @@ RSpec.describe API::GenericPackages do
end
end
context
'application security'
do
context
'application security'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:param_name
,
:param_value
)
do
where
(
:param_name
,
:param_value
)
do
:package_name
|
'my-package/../'
:package_name
|
'my-package/../'
:package_name
|
'my-package%2f%2e%2e%2f'
:package_name
|
'my-package%2f%2e%2e%2f'
...
...
spec/requests/api/pypi_packages_spec.rb
View file @
2b66d57d
...
@@ -5,6 +5,7 @@ RSpec.describe API::PypiPackages do
...
@@ -5,6 +5,7 @@ RSpec.describe API::PypiPackages do
include
WorkhorseHelpers
include
WorkhorseHelpers
include
PackagesManagerApiSpecHelpers
include
PackagesManagerApiSpecHelpers
include
HttpBasicAuthHelpers
include
HttpBasicAuthHelpers
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:public
)
}
...
@@ -20,8 +21,6 @@ RSpec.describe API::PypiPackages do
...
@@ -20,8 +21,6 @@ RSpec.describe API::PypiPackages do
subject
{
get
api
(
url
)
}
subject
{
get
api
(
url
)
}
context
'with valid project'
do
context
'with valid project'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:project_visibility_level
,
:user_role
,
:member
,
:user_token
,
:shared_examples_name
,
:expected_status
)
do
where
(
:project_visibility_level
,
:user_role
,
:member
,
:user_token
,
:shared_examples_name
,
:expected_status
)
do
'PUBLIC'
|
:developer
|
true
|
true
|
'PyPI package versions'
|
:success
'PUBLIC'
|
:developer
|
true
|
true
|
'PyPI package versions'
|
:success
'PUBLIC'
|
:guest
|
true
|
true
|
'PyPI package versions'
|
:success
'PUBLIC'
|
:guest
|
true
|
true
|
'PyPI package versions'
|
:success
...
@@ -83,8 +82,6 @@ RSpec.describe API::PypiPackages do
...
@@ -83,8 +82,6 @@ RSpec.describe API::PypiPackages do
subject
{
post
api
(
url
),
headers:
headers
}
subject
{
post
api
(
url
),
headers:
headers
}
context
'with valid project'
do
context
'with valid project'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:project_visibility_level
,
:user_role
,
:member
,
:user_token
,
:shared_examples_name
,
:expected_status
)
do
where
(
:project_visibility_level
,
:user_role
,
:member
,
:user_token
,
:shared_examples_name
,
:expected_status
)
do
'PUBLIC'
|
:developer
|
true
|
true
|
'process PyPI api request'
|
:success
'PUBLIC'
|
:developer
|
true
|
true
|
'process PyPI api request'
|
:success
'PUBLIC'
|
:guest
|
true
|
true
|
'process PyPI api request'
|
:forbidden
'PUBLIC'
|
:guest
|
true
|
true
|
'process PyPI api request'
|
:forbidden
...
@@ -149,8 +146,6 @@ RSpec.describe API::PypiPackages do
...
@@ -149,8 +146,6 @@ RSpec.describe API::PypiPackages do
end
end
context
'with valid project'
do
context
'with valid project'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:project_visibility_level
,
:user_role
,
:member
,
:user_token
,
:shared_examples_name
,
:expected_status
)
do
where
(
:project_visibility_level
,
:user_role
,
:member
,
:user_token
,
:shared_examples_name
,
:expected_status
)
do
'PUBLIC'
|
:developer
|
true
|
true
|
'PyPI package creation'
|
:created
'PUBLIC'
|
:developer
|
true
|
true
|
'PyPI package creation'
|
:created
'PUBLIC'
|
:guest
|
true
|
true
|
'process PyPI api request'
|
:forbidden
'PUBLIC'
|
:guest
|
true
|
true
|
'process PyPI api request'
|
:forbidden
...
@@ -239,8 +234,6 @@ RSpec.describe API::PypiPackages do
...
@@ -239,8 +234,6 @@ RSpec.describe API::PypiPackages do
subject
{
get
api
(
url
)
}
subject
{
get
api
(
url
)
}
context
'with valid project'
do
context
'with valid project'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:project_visibility_level
,
:user_role
,
:member
,
:user_token
,
:shared_examples_name
,
:expected_status
)
do
where
(
:project_visibility_level
,
:user_role
,
:member
,
:user_token
,
:shared_examples_name
,
:expected_status
)
do
'PUBLIC'
|
:developer
|
true
|
true
|
'PyPI package download'
|
:success
'PUBLIC'
|
:developer
|
true
|
true
|
'PyPI package download'
|
:success
'PUBLIC'
|
:guest
|
true
|
true
|
'PyPI package download'
|
:success
'PUBLIC'
|
:guest
|
true
|
true
|
'PyPI package download'
|
:success
...
...
spec/services/projects/prometheus/alerts/notify_service_spec.rb
View file @
2b66d57d
...
@@ -4,6 +4,7 @@ require 'spec_helper'
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Projects
::
Prometheus
::
Alerts
::
NotifyService
do
RSpec
.
describe
Projects
::
Prometheus
::
Alerts
::
NotifyService
do
include
PrometheusHelpers
include
PrometheusHelpers
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
...
@@ -61,8 +62,6 @@ RSpec.describe Projects::Prometheus::Alerts::NotifyService do
...
@@ -61,8 +62,6 @@ RSpec.describe Projects::Prometheus::Alerts::NotifyService do
end
end
context
'with project specific cluster'
do
context
'with project specific cluster'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:cluster_enabled
,
:status
,
:configured_token
,
:token_input
,
:result
)
do
where
(
:cluster_enabled
,
:status
,
:configured_token
,
:token_input
,
:result
)
do
true
|
:installed
|
token
|
token
|
:success
true
|
:installed
|
token
|
token
|
:success
true
|
:installed
|
nil
|
nil
|
:success
true
|
:installed
|
nil
|
nil
|
:success
...
@@ -104,8 +103,6 @@ RSpec.describe Projects::Prometheus::Alerts::NotifyService do
...
@@ -104,8 +103,6 @@ RSpec.describe Projects::Prometheus::Alerts::NotifyService do
end
end
context
'with manual prometheus installation'
do
context
'with manual prometheus installation'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:alerting_setting
,
:configured_token
,
:token_input
,
:result
)
do
where
(
:alerting_setting
,
:configured_token
,
:token_input
,
:result
)
do
true
|
token
|
token
|
:success
true
|
token
|
token
|
:success
true
|
token
|
'x'
|
:failure
true
|
token
|
'x'
|
:failure
...
@@ -139,8 +136,6 @@ RSpec.describe Projects::Prometheus::Alerts::NotifyService do
...
@@ -139,8 +136,6 @@ RSpec.describe Projects::Prometheus::Alerts::NotifyService do
end
end
context
'with HTTP integration'
do
context
'with HTTP integration'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:active
,
:token
,
:result
)
do
where
(
:active
,
:token
,
:result
)
do
:active
|
:valid
|
:success
:active
|
:valid
|
:success
:active
|
:invalid
|
:failure
:active
|
:invalid
|
:failure
...
...
spec/services/users/build_service_spec.rb
View file @
2b66d57d
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
Users
::
BuildService
do
RSpec
.
describe
Users
::
BuildService
do
using
RSpec
::
Parameterized
::
TableSyntax
describe
'#execute'
do
describe
'#execute'
do
let
(
:params
)
{
build_stubbed
(
:user
).
slice
(
:first_name
,
:last_name
,
:username
,
:email
,
:password
)
}
let
(
:params
)
{
build_stubbed
(
:user
).
slice
(
:first_name
,
:last_name
,
:username
,
:email
,
:password
)
}
...
@@ -72,8 +74,6 @@ RSpec.describe Users::BuildService do
...
@@ -72,8 +74,6 @@ RSpec.describe Users::BuildService do
end
end
context
'with "user_default_external" application setting'
do
context
'with "user_default_external" application setting'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:user_default_external
,
:external
,
:email
,
:user_default_internal_regex
,
:result
)
do
where
(
:user_default_external
,
:external
,
:email
,
:user_default_internal_regex
,
:result
)
do
true
|
nil
|
'fl@example.com'
|
nil
|
true
true
|
nil
|
'fl@example.com'
|
nil
|
true
true
|
true
|
'fl@example.com'
|
nil
|
true
true
|
true
|
'fl@example.com'
|
nil
|
true
...
@@ -192,8 +192,6 @@ RSpec.describe Users::BuildService do
...
@@ -192,8 +192,6 @@ RSpec.describe Users::BuildService do
end
end
context
'with "user_default_external" application setting'
do
context
'with "user_default_external" application setting'
do
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:user_default_external
,
:external
,
:email
,
:user_default_internal_regex
,
:result
)
do
where
(
:user_default_external
,
:external
,
:email
,
:user_default_internal_regex
,
:result
)
do
true
|
nil
|
'fl@example.com'
|
nil
|
true
true
|
nil
|
'fl@example.com'
|
nil
|
true
true
|
true
|
'fl@example.com'
|
nil
|
true
true
|
true
|
'fl@example.com'
|
nil
|
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