diff --git a/.rubocop.yml b/.rubocop.yml index 388fba593..e8376a710 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -108,4 +108,7 @@ RSpec/InvalidPredicateMatcher: Enabled: true RSpec/ItBehavesLike: + Enabled: true + +RSpec/IteratedExpectation: Enabled: true \ No newline at end of file diff --git a/spec/features/moderation/comments_spec.rb b/spec/features/moderation/comments_spec.rb index ea6821a8d..2bf89bfaa 100644 --- a/spec/features/moderation/comments_spec.rb +++ b/spec/features/moderation/comments_spec.rb @@ -90,9 +90,7 @@ feature 'Moderate comments' do within('.js-check') { click_on 'All' } - all('input[type=checkbox]').each do |checkbox| - expect(checkbox).to be_checked - end + expect(all('input[type=checkbox]')).to all(be_checked) within('.js-check') { click_on 'None' } diff --git a/spec/features/moderation/debates_spec.rb b/spec/features/moderation/debates_spec.rb index a642eb0a4..f62ccd76b 100644 --- a/spec/features/moderation/debates_spec.rb +++ b/spec/features/moderation/debates_spec.rb @@ -99,9 +99,7 @@ feature 'Moderate debates' do within('.js-check') { click_on 'All' } - all('input[type=checkbox]').each do |checkbox| - expect(checkbox).to be_checked - end + expect(all('input[type=checkbox]')).to all(be_checked) within('.js-check') { click_on 'None' } diff --git a/spec/features/moderation/proposals_spec.rb b/spec/features/moderation/proposals_spec.rb index df0a92395..eb2e0e247 100644 --- a/spec/features/moderation/proposals_spec.rb +++ b/spec/features/moderation/proposals_spec.rb @@ -99,9 +99,7 @@ feature 'Moderate proposals' do within('.js-check') { click_on 'All' } - all('input[type=checkbox]').each do |checkbox| - expect(checkbox).to be_checked - end + expect(all('input[type=checkbox]')).to all(be_checked) within('.js-check') { click_on 'None' }