Use the AttributeDefinedStatically rubocop rule

Factory bot has stopped supporting dynamic attributes, and we'll have to
change all factories before upgrading.

In order to apply the rubocop rule, we need to bump rubocop-rspec to its
latest version.
This commit is contained in:
Javi Martín
2019-06-18 01:44:44 +02:00
parent 61be48a6c6
commit 444fc524f7
4 changed files with 18 additions and 19 deletions

View File

@@ -351,12 +351,6 @@ RSpec/VerifiedDoubles:
RSpec/VoidExpect: RSpec/VoidExpect:
Enabled: true Enabled: true
FactoryBot/StaticAttributeDefinedDynamically:
Enabled: true
FactoryBot/DynamicAttributeDefinedStatically:
Enabled: false
Security/Eval: Security/Eval:
Enabled: true Enabled: true

View File

@@ -20,6 +20,9 @@ Capybara/FeatureMethods:
- scenario - scenario
- xscenario - xscenario
FactoryBot/AttributeDefinedStatically:
Enabled: true
Layout/IndentationConsistency: Layout/IndentationConsistency:
EnforcedStyle: rails EnforcedStyle: rails

View File

@@ -96,8 +96,8 @@ group :development do
gem "capistrano3-delayed-job", "~> 1.7.3" gem "capistrano3-delayed-job", "~> 1.7.3"
gem "erb_lint", require: false gem "erb_lint", require: false
gem "mdl", "~> 0.5.0", require: false gem "mdl", "~> 0.5.0", require: false
gem "rubocop", "~> 0.54.0", require: false gem "rubocop", "~> 0.60.0", require: false
gem "rubocop-rspec", "~> 1.26.0", require: false gem "rubocop-rspec", "~> 1.33.0", require: false
gem "rvm1-capistrano3", "~> 1.4.0", require: false gem "rvm1-capistrano3", "~> 1.4.0", require: false
gem "scss_lint", "~> 0.55.0", require: false gem "scss_lint", "~> 0.55.0", require: false
gem "web-console", "~> 3.3.0" gem "web-console", "~> 3.3.0"

View File

@@ -270,6 +270,7 @@ GEM
railties (>= 3.1, < 6.0) railties (>= 3.1, < 6.0)
invisible_captcha (0.10.0) invisible_captcha (0.10.0)
rails (>= 3.2.0) rails (>= 3.2.0)
jaro_winkler (1.5.2)
jquery-fileupload-rails (0.4.7) jquery-fileupload-rails (0.4.7)
actionpack (>= 3.1) actionpack (>= 3.1)
railties (>= 3.1) railties (>= 3.1)
@@ -370,10 +371,10 @@ GEM
cocaine (~> 0.5.5) cocaine (~> 0.5.5)
mime-types mime-types
mimemagic (~> 0.3.0) mimemagic (~> 0.3.0)
parallel (1.12.1) parallel (1.17.0)
paranoia (2.4.1) paranoia (2.4.1)
activerecord (>= 4.0, < 5.3) activerecord (>= 4.0, < 5.3)
parser (2.5.1.2) parser (2.6.3.0)
ast (~> 2.4.0) ast (~> 2.4.0)
pg (0.21.0) pg (0.21.0)
pg_search (2.0.1) pg_search (2.0.1)
@@ -447,16 +448,17 @@ GEM
rspec-mocks (~> 3.8.0) rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0) rspec-support (~> 3.8.0)
rspec-support (3.8.0) rspec-support (3.8.0)
rubocop (0.54.0) rubocop (0.60.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.5) parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1) powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1) unicode-display_width (~> 1.4.0)
rubocop-rspec (1.26.0) rubocop-rspec (1.33.0)
rubocop (>= 0.53.0) rubocop (>= 0.60.0)
ruby-progressbar (1.10.0) ruby-progressbar (1.10.1)
rubyzip (1.2.2) rubyzip (1.2.2)
rvm1-capistrano3 (1.4.0) rvm1-capistrano3 (1.4.0)
capistrano (~> 3.0) capistrano (~> 3.0)
@@ -536,7 +538,7 @@ GEM
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.1.19) uglifier (4.1.19)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unicode-display_width (1.4.0) unicode-display_width (1.4.1)
unicorn (5.4.1) unicorn (5.4.1)
kgio (~> 2.6) kgio (~> 2.6)
raindrops (~> 0.7) raindrops (~> 0.7)
@@ -634,8 +636,8 @@ DEPENDENCIES
rinku (~> 2.0.2) rinku (~> 2.0.2)
rollbar (~> 2.18.0) rollbar (~> 2.18.0)
rspec-rails (~> 3.8) rspec-rails (~> 3.8)
rubocop (~> 0.54.0) rubocop (~> 0.60.0)
rubocop-rspec (~> 1.26.0) rubocop-rspec (~> 1.33.0)
rvm1-capistrano3 (~> 1.4.0) rvm1-capistrano3 (~> 1.4.0)
sass-rails (~> 5.0, >= 5.0.4) sass-rails (~> 5.0, >= 5.0.4)
savon (~> 2.12.0) savon (~> 2.12.0)