From e2c42a3c63ab90b0fadfd3444c9cc402341d458e Mon Sep 17 00:00:00 2001 From: Bertocq Date: Wed, 7 Mar 2018 13:44:54 +0100 Subject: [PATCH] Enable StaticAttributeDefinedDynamically cop & fix rubocop-rspec gem includes cops for FactoryBot like the new FactoryBot/StaticAttributeDefinedDynamically to enforce declaring static attribute values without a block. * http://www.rubydoc.info/gems/rubocop-rspec/1.24.0/RuboCop/Cop/RSpec/FactoryBot/StaticAttributeDefinedDynamically --- .rubocop.yml | 3 +++ spec/factories.rb | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 34c798d5f..4b4bf3148 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -403,6 +403,9 @@ RSpec/VerifiedDoubles: RSpec/VoidExpect: Enabled: true +FactoryBot/StaticAttributeDefinedDynamically: + Enabled: true + Security/Eval: Enabled: true diff --git a/spec/factories.rb b/spec/factories.rb index 2f9cc4acc..6df58f03b 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -638,13 +638,13 @@ FactoryBot.define do factory :poll_partial_result, class: 'Poll::PartialResult' do association :question, factory: [:poll_question, :with_answers] association :author, factory: :user - origin { 'web' } + origin 'web' answer { question.question_answers.sample.title } end factory :poll_recount, class: 'Poll::Recount' do association :author, factory: :user - origin { 'web' } + origin 'web' end factory :officing_residence, class: 'Officing::Residence' do