diff --git a/.rubocop.yml b/.rubocop.yml index a64b6f7d0..37c46bef1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -210,9 +210,6 @@ RSpec/EmptyLineAfterSubject: RSpec/ExampleLength: Enabled: false -RSpec/ExampleWording: - Enabled: true - RSpec/ExpectActual: Enabled: true diff --git a/.rubocop_basic.yml b/.rubocop_basic.yml index 127a6dca8..269326ad2 100644 --- a/.rubocop_basic.yml +++ b/.rubocop_basic.yml @@ -160,6 +160,9 @@ Rails/UnknownEnv: Rails/Validation: Enabled: true +RSpec/ExampleWording: + Enabled: true + RSpec/NotToNot: Enabled: true diff --git a/spec/models/budget_spec.rb b/spec/models/budget_spec.rb index 851d6076a..1ea1d534a 100644 --- a/spec/models/budget_spec.rb +++ b/spec/models/budget_spec.rb @@ -223,7 +223,7 @@ describe Budget do end describe "#has_winning_investments?" do - it "should return true if there is a winner investment" do + it "returns true if there is a winner investment" do budget.investments << build(:budget_investment, :winner, price: 3, ballot_lines_count: 2) expect(budget.has_winning_investments?).to eq true diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb index 54d680267..155764883 100644 --- a/spec/models/notification_spec.rb +++ b/spec/models/notification_spec.rb @@ -6,11 +6,11 @@ describe Notification do context "validations" do - it "should be valid" do + it "is valid" do expect(notification).to be_valid end - it "should not be valid without a user" do + it "is not valid without a user" do notification.user = nil expect(notification).not_to be_valid end diff --git a/spec/models/poll/voter_spec.rb b/spec/models/poll/voter_spec.rb index aab54eb42..4c4ec9a5e 100644 --- a/spec/models/poll/voter_spec.rb +++ b/spec/models/poll/voter_spec.rb @@ -109,19 +109,19 @@ describe Poll::Voter do end context "assignments" do - it "should not be valid without a booth_assignment_id when origin is booth" do + it "is not valid without a booth_assignment_id when origin is booth" do voter.origin = "booth" voter.booth_assignment_id = nil expect(voter).not_to be_valid end - it "should not be valid without an officer_assignment_id when origin is booth" do + it "is not valid without an officer_assignment_id when origin is booth" do voter.origin = "booth" voter.officer_assignment_id = nil expect(voter).not_to be_valid end - it "should be valid without assignments when origin is web" do + it "is valid without assignments when origin is web" do voter.origin = "web" voter.booth_assignment_id = nil voter.officer_assignment_id = nil diff --git a/spec/models/setting_spec.rb b/spec/models/setting_spec.rb index 282dc6d47..a82c4e33a 100644 --- a/spec/models/setting_spec.rb +++ b/spec/models/setting_spec.rb @@ -9,7 +9,7 @@ describe Setting do expect(described_class["official_level_1_name"]).to eq("Stormtrooper") end - it "shoulds return nil" do + it "returns nil" do expect(described_class["undefined_key"]).to eq(nil) end diff --git a/spec/models/valuator_group_spec.rb b/spec/models/valuator_group_spec.rb index 910fd7ec7..2aadfb31b 100644 --- a/spec/models/valuator_group_spec.rb +++ b/spec/models/valuator_group_spec.rb @@ -3,15 +3,15 @@ require "rails_helper" describe ValuatorGroup do describe "Validations" do - it "should be valid" do + it "is valid" do expect(build(:valuator_group)).to be_valid end - it "should not be valid without a name" do + it "is not valid without a name" do expect(build(:valuator_group, name: nil)).not_to be_valid end - it "should not be valid with the same name as an existing one" do + it "is not valid with the same name as an existing one" do create(:valuator_group, name: "The Valuators") expect(build(:valuator_group, name: "The Valuators")).not_to be_valid diff --git a/spec/shared/models/acts_as_paranoid.rb b/spec/shared/models/acts_as_paranoid.rb index 63c392915..dbe3d337e 100644 --- a/spec/shared/models/acts_as_paranoid.rb +++ b/spec/shared/models/acts_as_paranoid.rb @@ -14,14 +14,14 @@ shared_examples "acts as paranoid" do |factory_name| describe "#{described_class} translations" do - it "should be hidden after parent resource destroy" do + it "is hidden after parent resource destroy" do resource.destroy resource.reload expect(resource.translations.with_deleted.first.hidden_at).not_to be_blank end - it "should be destroyed after parent resource really_destroy" do + it "is destroyed after parent resource really_destroy" do expect { resource.really_destroy! }.to change { resource.translations.with_deleted.count }.from(1).to(0) end