From 4f6597b2004913b5dd5062984bb2b014181660a1 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Sun, 7 Jan 2018 17:45:34 +0100 Subject: [PATCH] Enable RSpec/RepeatedDescription cop & fix all issues Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription --- .rubocop.yml | 3 +++ spec/features/legislation/processes_spec.rb | 2 +- spec/lib/migrate_spending_proposals_to_investments_spec.rb | 2 +- spec/models/proposal_spec.rb | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 6cab21fa8..cc9a083c4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -155,4 +155,7 @@ RSpec/OverwritingSetup: Enabled: true RSpec/PredicateMatcher: + Enabled: true + +RSpec/RepeatedDescription: Enabled: true \ No newline at end of file diff --git a/spec/features/legislation/processes_spec.rb b/spec/features/legislation/processes_spec.rb index 79565d110..6dbc6f475 100644 --- a/spec/features/legislation/processes_spec.rb +++ b/spec/features/legislation/processes_spec.rb @@ -26,7 +26,7 @@ feature 'Legislation' do context 'processes home page' do - scenario 'Processes can be listed' do + scenario 'No processes to be listed' do visit legislation_processes_path expect(page).to have_text "There aren't open processes" diff --git a/spec/lib/migrate_spending_proposals_to_investments_spec.rb b/spec/lib/migrate_spending_proposals_to_investments_spec.rb index 20817811c..bd206220b 100644 --- a/spec/lib/migrate_spending_proposals_to_investments_spec.rb +++ b/spec/lib/migrate_spending_proposals_to_investments_spec.rb @@ -31,7 +31,7 @@ describe MigrateSpendingProposalsToInvestments do expect(inv.heading.group.name).to eq("Toda la ciudad") end - it "Imports a city spending proposal" do + it "Imports a district spending proposal" do sp = create(:spending_proposal, geozone: create(:geozone, name: "Bel Air")) inv = importer.import(sp) diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index 28c620d36..bf505e8b7 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -108,7 +108,7 @@ describe Proposal do proposal.responsible_name = "12345678Z" end - it "is the document_number if level two user" do + it "is the document_number if level three user" do author = create(:user, :level_three, document_number: "12345678Z") proposal.author = author proposal.responsible_name = nil @@ -854,7 +854,7 @@ describe Proposal do expect(archived.first).to eq(archived_proposal) end - it "scope archived" do + it "scope not archived" do not_archived = described_class.not_archived expect(not_archived.size).to eq(1)