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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
87b85ef8
Commit
87b85ef8
authored
Sep 20, 2018
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix DynamicAttributeDefinedStatically cop
parent
67cdb1d1
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
26 additions
and
45 deletions
+26
-45
.rubocop_todo.yml
.rubocop_todo.yml
+0
-18
spec/factories/broadcast_messages.rb
spec/factories/broadcast_messages.rb
+6
-6
spec/factories/ci/builds.rb
spec/factories/ci/builds.rb
+3
-3
spec/factories/ci/runners.rb
spec/factories/ci/runners.rb
+1
-1
spec/factories/clusters/applications/helm.rb
spec/factories/clusters/applications/helm.rb
+1
-1
spec/factories/clusters/platforms/kubernetes.rb
spec/factories/clusters/platforms/kubernetes.rb
+1
-2
spec/factories/emails.rb
spec/factories/emails.rb
+1
-1
spec/factories/gpg_keys.rb
spec/factories/gpg_keys.rb
+2
-2
spec/factories/group_members.rb
spec/factories/group_members.rb
+1
-1
spec/factories/merge_requests.rb
spec/factories/merge_requests.rb
+1
-1
spec/factories/notes.rb
spec/factories/notes.rb
+1
-1
spec/factories/oauth_access_grants.rb
spec/factories/oauth_access_grants.rb
+1
-1
spec/factories/project_members.rb
spec/factories/project_members.rb
+1
-1
spec/factories/todos.rb
spec/factories/todos.rb
+1
-1
spec/factories/uploads.rb
spec/factories/uploads.rb
+5
-5
No files found.
.rubocop_todo.yml
View file @
87b85ef8
...
@@ -10,24 +10,6 @@
...
@@ -10,24 +10,6 @@
Capybara/CurrentPathExpectation
:
Capybara/CurrentPathExpectation
:
Enabled
:
false
Enabled
:
false
# Offense count: 23
FactoryBot/DynamicAttributeDefinedStatically
:
Exclude
:
-
'
spec/factories/broadcast_messages.rb'
-
'
spec/factories/ci/builds.rb'
-
'
spec/factories/ci/runners.rb'
-
'
spec/factories/clusters/applications/helm.rb'
-
'
spec/factories/clusters/platforms/kubernetes.rb'
-
'
spec/factories/emails.rb'
-
'
spec/factories/gpg_keys.rb'
-
'
spec/factories/group_members.rb'
-
'
spec/factories/merge_requests.rb'
-
'
spec/factories/notes.rb'
-
'
spec/factories/oauth_access_grants.rb'
-
'
spec/factories/project_members.rb'
-
'
spec/factories/todos.rb'
-
'
spec/factories/uploads.rb'
# Offense count: 167
# Offense count: 167
# Cop supports --auto-correct.
# Cop supports --auto-correct.
Layout/EmptyLinesAroundArguments
:
Layout/EmptyLinesAroundArguments
:
...
...
spec/factories/broadcast_messages.rb
View file @
87b85ef8
FactoryBot
.
define
do
FactoryBot
.
define
do
factory
:broadcast_message
do
factory
:broadcast_message
do
message
"MyText"
message
"MyText"
starts_at
1
.
day
.
ago
starts_at
{
1
.
day
.
ago
}
ends_at
1
.
day
.
from_now
ends_at
{
1
.
day
.
from_now
}
trait
:expired
do
trait
:expired
do
starts_at
5
.
days
.
ago
starts_at
{
5
.
days
.
ago
}
ends_at
3
.
days
.
ago
ends_at
{
3
.
days
.
ago
}
end
end
trait
:future
do
trait
:future
do
starts_at
5
.
days
.
from_now
starts_at
{
5
.
days
.
from_now
}
ends_at
6
.
days
.
from_now
ends_at
{
6
.
days
.
from_now
}
end
end
end
end
end
end
spec/factories/ci/builds.rb
View file @
87b85ef8
...
@@ -159,12 +159,12 @@ FactoryBot.define do
...
@@ -159,12 +159,12 @@ FactoryBot.define do
end
end
trait
:erased
do
trait
:erased
do
erased_at
Time
.
now
erased_at
{
Time
.
now
}
erased_by
factory: :user
erased_by
factory: :user
end
end
trait
:queued
do
trait
:queued
do
queued_at
Time
.
now
queued_at
{
Time
.
now
}
runner
factory: :ci_runner
runner
factory: :ci_runner
end
end
...
@@ -194,7 +194,7 @@ FactoryBot.define do
...
@@ -194,7 +194,7 @@ FactoryBot.define do
end
end
trait
:expired
do
trait
:expired
do
artifacts_expire_at
1
.
minute
.
ago
artifacts_expire_at
{
1
.
minute
.
ago
}
end
end
trait
:with_commit
do
trait
:with_commit
do
...
...
spec/factories/ci/runners.rb
View file @
87b85ef8
...
@@ -9,7 +9,7 @@ FactoryBot.define do
...
@@ -9,7 +9,7 @@ FactoryBot.define do
runner_type
:instance_type
runner_type
:instance_type
trait
:online
do
trait
:online
do
contacted_at
Time
.
now
contacted_at
{
Time
.
now
}
end
end
trait
:instance
do
trait
:instance
do
...
...
spec/factories/clusters/applications/helm.rb
View file @
87b85ef8
...
@@ -29,7 +29,7 @@ FactoryBot.define do
...
@@ -29,7 +29,7 @@ FactoryBot.define do
trait
:timeouted
do
trait
:timeouted
do
installing
installing
updated_at
ClusterWaitForAppInstallationWorker
::
TIMEOUT
.
ago
updated_at
{
ClusterWaitForAppInstallationWorker
::
TIMEOUT
.
ago
}
end
end
factory
:clusters_applications_ingress
,
class:
Clusters
::
Applications
::
Ingress
do
factory
:clusters_applications_ingress
,
class:
Clusters
::
Applications
::
Ingress
do
...
...
spec/factories/clusters/platforms/kubernetes.rb
View file @
87b85ef8
...
@@ -3,11 +3,10 @@ FactoryBot.define do
...
@@ -3,11 +3,10 @@ FactoryBot.define do
cluster
cluster
namespace
nil
namespace
nil
api_url
'https://kubernetes.example.com'
api_url
'https://kubernetes.example.com'
token
'a'
*
40
token
{
'a'
*
40
}
trait
:configured
do
trait
:configured
do
api_url
'https://kubernetes.example.com'
api_url
'https://kubernetes.example.com'
token
'a'
*
40
username
'xxxxxx'
username
'xxxxxx'
password
'xxxxxx'
password
'xxxxxx'
...
...
spec/factories/emails.rb
View file @
87b85ef8
...
@@ -3,7 +3,7 @@ FactoryBot.define do
...
@@ -3,7 +3,7 @@ FactoryBot.define do
user
user
email
{
generate
(
:email_alias
)
}
email
{
generate
(
:email_alias
)
}
trait
(
:confirmed
)
{
confirmed_at
Time
.
now
}
trait
(
:confirmed
)
{
confirmed_at
{
Time
.
now
}
}
trait
(
:skip_validate
)
{
to_create
{
|
instance
|
instance
.
save
(
validate:
false
)
}
}
trait
(
:skip_validate
)
{
to_create
{
|
instance
|
instance
.
save
(
validate:
false
)
}
}
end
end
end
end
spec/factories/gpg_keys.rb
View file @
87b85ef8
...
@@ -2,11 +2,11 @@ require_relative '../support/helpers/gpg_helpers'
...
@@ -2,11 +2,11 @@ require_relative '../support/helpers/gpg_helpers'
FactoryBot
.
define
do
FactoryBot
.
define
do
factory
:gpg_key
do
factory
:gpg_key
do
key
GpgHelpers
::
User1
.
public_key
key
{
GpgHelpers
::
User1
.
public_key
}
user
user
factory
:gpg_key_with_subkeys
do
factory
:gpg_key_with_subkeys
do
key
GpgHelpers
::
User1
.
public_key_with_extra_signing_key
key
{
GpgHelpers
::
User1
.
public_key_with_extra_signing_key
}
end
end
end
end
end
end
spec/factories/group_members.rb
View file @
87b85ef8
...
@@ -9,7 +9,7 @@ FactoryBot.define do
...
@@ -9,7 +9,7 @@ FactoryBot.define do
trait
(
:developer
)
{
access_level
GroupMember
::
DEVELOPER
}
trait
(
:developer
)
{
access_level
GroupMember
::
DEVELOPER
}
trait
(
:maintainer
)
{
access_level
GroupMember
::
MAINTAINER
}
trait
(
:maintainer
)
{
access_level
GroupMember
::
MAINTAINER
}
trait
(
:owner
)
{
access_level
GroupMember
::
OWNER
}
trait
(
:owner
)
{
access_level
GroupMember
::
OWNER
}
trait
(
:access_request
)
{
requested_at
Time
.
now
}
trait
(
:access_request
)
{
requested_at
{
Time
.
now
}
}
trait
(
:invited
)
do
trait
(
:invited
)
do
user_id
nil
user_id
nil
...
...
spec/factories/merge_requests.rb
View file @
87b85ef8
...
@@ -80,7 +80,7 @@ FactoryBot.define do
...
@@ -80,7 +80,7 @@ FactoryBot.define do
trait
:merge_when_pipeline_succeeds
do
trait
:merge_when_pipeline_succeeds
do
merge_when_pipeline_succeeds
true
merge_when_pipeline_succeeds
true
merge_user
author
merge_user
{
author
}
end
end
trait
:remove_source_branch
do
trait
:remove_source_branch
do
...
...
spec/factories/notes.rb
View file @
87b85ef8
...
@@ -90,7 +90,7 @@ FactoryBot.define do
...
@@ -90,7 +90,7 @@ FactoryBot.define do
noteable
nil
noteable
nil
noteable_type
'Commit'
noteable_type
'Commit'
noteable_id
nil
noteable_id
nil
commit_id
RepoHelpers
.
sample_commit
.
id
commit_id
{
RepoHelpers
.
sample_commit
.
id
}
end
end
trait
:legacy_diff_note
do
trait
:legacy_diff_note
do
...
...
spec/factories/oauth_access_grants.rb
View file @
87b85ef8
...
@@ -3,7 +3,7 @@ FactoryBot.define do
...
@@ -3,7 +3,7 @@ FactoryBot.define do
resource_owner_id
{
create
(
:user
).
id
}
resource_owner_id
{
create
(
:user
).
id
}
application
application
token
{
Doorkeeper
::
OAuth
::
Helpers
::
UniqueToken
.
generate
}
token
{
Doorkeeper
::
OAuth
::
Helpers
::
UniqueToken
.
generate
}
expires_in
2
.
hours
expires_in
{
2
.
hours
}
redirect_uri
{
application
.
redirect_uri
}
redirect_uri
{
application
.
redirect_uri
}
scopes
{
application
.
scopes
}
scopes
{
application
.
scopes
}
...
...
spec/factories/project_members.rb
View file @
87b85ef8
...
@@ -8,7 +8,7 @@ FactoryBot.define do
...
@@ -8,7 +8,7 @@ FactoryBot.define do
trait
(
:reporter
)
{
access_level
ProjectMember
::
REPORTER
}
trait
(
:reporter
)
{
access_level
ProjectMember
::
REPORTER
}
trait
(
:developer
)
{
access_level
ProjectMember
::
DEVELOPER
}
trait
(
:developer
)
{
access_level
ProjectMember
::
DEVELOPER
}
trait
(
:maintainer
)
{
access_level
ProjectMember
::
MAINTAINER
}
trait
(
:maintainer
)
{
access_level
ProjectMember
::
MAINTAINER
}
trait
(
:access_request
)
{
requested_at
Time
.
now
}
trait
(
:access_request
)
{
requested_at
{
Time
.
now
}
}
trait
(
:invited
)
do
trait
(
:invited
)
do
user_id
nil
user_id
nil
...
...
spec/factories/todos.rb
View file @
87b85ef8
...
@@ -49,7 +49,7 @@ FactoryBot.define do
...
@@ -49,7 +49,7 @@ FactoryBot.define do
author
author
user
user
action
{
Todo
::
ASSIGNED
}
action
{
Todo
::
ASSIGNED
}
commit_id
RepoHelpers
.
sample_commit
.
id
commit_id
{
RepoHelpers
.
sample_commit
.
id
}
target_type
"Commit"
target_type
"Commit"
end
end
end
end
spec/factories/uploads.rb
View file @
87b85ef8
FactoryBot
.
define
do
FactoryBot
.
define
do
factory
:upload
do
factory
:upload
do
model
{
build
(
:project
)
}
model
{
build
(
:project
)
}
size
100
.
kilobytes
size
{
100
.
kilobytes
}
uploader
"AvatarUploader"
uploader
"AvatarUploader"
mount_point
:avatar
mount_point
:avatar
secret
nil
secret
nil
...
@@ -19,13 +19,13 @@ FactoryBot.define do
...
@@ -19,13 +19,13 @@ FactoryBot.define do
uploader
"PersonalFileUploader"
uploader
"PersonalFileUploader"
path
{
File
.
join
(
secret
,
filename
)
}
path
{
File
.
join
(
secret
,
filename
)
}
model
{
build
(
:personal_snippet
)
}
model
{
build
(
:personal_snippet
)
}
secret
SecureRandom
.
hex
secret
{
SecureRandom
.
hex
}
end
end
trait
:issuable_upload
do
trait
:issuable_upload
do
uploader
"FileUploader"
uploader
"FileUploader"
path
{
File
.
join
(
secret
,
filename
)
}
path
{
File
.
join
(
secret
,
filename
)
}
secret
SecureRandom
.
hex
secret
{
SecureRandom
.
hex
}
end
end
trait
:with_file
do
trait
:with_file
do
...
@@ -43,14 +43,14 @@ FactoryBot.define do
...
@@ -43,14 +43,14 @@ FactoryBot.define do
model
{
build
(
:group
)
}
model
{
build
(
:group
)
}
path
{
File
.
join
(
secret
,
filename
)
}
path
{
File
.
join
(
secret
,
filename
)
}
uploader
"NamespaceFileUploader"
uploader
"NamespaceFileUploader"
secret
SecureRandom
.
hex
secret
{
SecureRandom
.
hex
}
end
end
trait
:favicon_upload
do
trait
:favicon_upload
do
model
{
build
(
:appearance
)
}
model
{
build
(
:appearance
)
}
path
{
File
.
join
(
secret
,
filename
)
}
path
{
File
.
join
(
secret
,
filename
)
}
uploader
"FaviconUploader"
uploader
"FaviconUploader"
secret
SecureRandom
.
hex
secret
{
SecureRandom
.
hex
}
end
end
trait
:attachment_upload
do
trait
:attachment_upload
do
...
...
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