Apply RSpec/ExampleWording rubocop rule

This commit is contained in:
Javi Martín
2019-06-23 01:07:25 +02:00
parent 0788925c1b
commit 58ba517717
8 changed files with 15 additions and 15 deletions

View File

@@ -210,9 +210,6 @@ RSpec/EmptyLineAfterSubject:
RSpec/ExampleLength: RSpec/ExampleLength:
Enabled: false Enabled: false
RSpec/ExampleWording:
Enabled: true
RSpec/ExpectActual: RSpec/ExpectActual:
Enabled: true Enabled: true

View File

@@ -160,6 +160,9 @@ Rails/UnknownEnv:
Rails/Validation: Rails/Validation:
Enabled: true Enabled: true
RSpec/ExampleWording:
Enabled: true
RSpec/NotToNot: RSpec/NotToNot:
Enabled: true Enabled: true

View File

@@ -223,7 +223,7 @@ describe Budget do
end end
describe "#has_winning_investments?" do 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) budget.investments << build(:budget_investment, :winner, price: 3, ballot_lines_count: 2)
expect(budget.has_winning_investments?).to eq true expect(budget.has_winning_investments?).to eq true

View File

@@ -6,11 +6,11 @@ describe Notification do
context "validations" do context "validations" do
it "should be valid" do it "is valid" do
expect(notification).to be_valid expect(notification).to be_valid
end end
it "should not be valid without a user" do it "is not valid without a user" do
notification.user = nil notification.user = nil
expect(notification).not_to be_valid expect(notification).not_to be_valid
end end

View File

@@ -109,19 +109,19 @@ describe Poll::Voter do
end end
context "assignments" do 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.origin = "booth"
voter.booth_assignment_id = nil voter.booth_assignment_id = nil
expect(voter).not_to be_valid expect(voter).not_to be_valid
end 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.origin = "booth"
voter.officer_assignment_id = nil voter.officer_assignment_id = nil
expect(voter).not_to be_valid expect(voter).not_to be_valid
end 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.origin = "web"
voter.booth_assignment_id = nil voter.booth_assignment_id = nil
voter.officer_assignment_id = nil voter.officer_assignment_id = nil

View File

@@ -9,7 +9,7 @@ describe Setting do
expect(described_class["official_level_1_name"]).to eq("Stormtrooper") expect(described_class["official_level_1_name"]).to eq("Stormtrooper")
end end
it "shoulds return nil" do it "returns nil" do
expect(described_class["undefined_key"]).to eq(nil) expect(described_class["undefined_key"]).to eq(nil)
end end

View File

@@ -3,15 +3,15 @@ require "rails_helper"
describe ValuatorGroup do describe ValuatorGroup do
describe "Validations" do describe "Validations" do
it "should be valid" do it "is valid" do
expect(build(:valuator_group)).to be_valid expect(build(:valuator_group)).to be_valid
end 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 expect(build(:valuator_group, name: nil)).not_to be_valid
end 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") create(:valuator_group, name: "The Valuators")
expect(build(:valuator_group, name: "The Valuators")).not_to be_valid expect(build(:valuator_group, name: "The Valuators")).not_to be_valid

View File

@@ -14,14 +14,14 @@ shared_examples "acts as paranoid" do |factory_name|
describe "#{described_class} translations" do 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.destroy
resource.reload resource.reload
expect(resource.translations.with_deleted.first.hidden_at).not_to be_blank expect(resource.translations.with_deleted.first.hidden_at).not_to be_blank
end 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) expect { resource.really_destroy! }.to change { resource.translations.with_deleted.count }.from(1).to(0)
end end