diff --git a/.rubocop.yml b/.rubocop.yml index c5489715..9ebef319 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,8 @@ inherit_from: .rubocop_todo.yml require: - rubocop-rails - rubocop-rspec + - rubocop-capybara + - rubocop-factory_bot AllCops: NewCops: enable diff --git a/Gemfile.lock b/Gemfile.lock index f4c115e3..28a7f790 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -313,7 +313,7 @@ GEM parser (>= 3.2.1.0) rubocop-capybara (2.18.0) rubocop (~> 1.41) - rubocop-factory_bot (2.22.0) + rubocop-factory_bot (2.23.1) rubocop (~> 1.33) rubocop-rails (2.19.1) activesupport (>= 4.2.0) diff --git a/spec/factories/comments.rb b/spec/factories/comments.rb index 4261ff11..7b4f2126 100644 --- a/spec/factories/comments.rb +++ b/spec/factories/comments.rb @@ -1,7 +1,7 @@ FactoryBot.define do factory :comment do - association :commenter, factory: :user - association :commentable, factory: :project + commenter factory: %i[user] + commentable factory: %i[project] text { 'Sample' } diff --git a/spec/factories/notifications.rb b/spec/factories/notifications.rb index df483e54..61001e79 100644 --- a/spec/factories/notifications.rb +++ b/spec/factories/notifications.rb @@ -3,7 +3,7 @@ read_at { nil } recipient_id { 1 } action { 'string' } - association :actor, factory: :user - association :notifiable, factory: :project + actor factory: %i[user] + notifiable factory: %i[project] end end diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index 8d3e83cf..a743b27d 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -7,7 +7,7 @@ likes_count { 0 } memberships_count { 0 } aasm_state { 'idea' } - association :originator, factory: :user + originator factory: %i[user] factory :idea, class: Project do aasm_state { 'idea' }