Add and apply RSpec/BeEq rubocop rule

This rule was added in rubocop-rspec 2.9.0. Once again, we were applying
it about 50% of the time.
This commit is contained in:
Javi Martín
2023-08-29 19:14:49 +02:00
parent 6268ae9274
commit f79a21f071
31 changed files with 213 additions and 210 deletions

View File

@@ -5,21 +5,21 @@ describe ApplicationHelper do
it "is true if user is the author" do
user = create(:user)
proposal = create(:proposal, author: user)
expect(author_of?(proposal, user)).to eq true
expect(author_of?(proposal, user)).to be true
end
it "is false if user is not the author" do
user = create(:user)
proposal = create(:proposal)
expect(author_of?(proposal, user)).to eq false
expect(author_of?(proposal, user)).to be false
end
it "is false if user or authorable is nil" do
user = create(:user)
proposal = create(:proposal)
expect(author_of?(nil, user)).to eq false
expect(author_of?(proposal, nil)).to eq false
expect(author_of?(nil, user)).to be false
expect(author_of?(proposal, nil)).to be false
end
end
end

View File

@@ -10,22 +10,22 @@ describe LegislationHelper do
describe "banner colors presence" do
it "background and font color exist" do
@process = build(:legislation_process, background_color: "#944949", font_color: "#ffffff")
expect(banner_color?).to eq(true)
expect(banner_color?).to be true
end
it "background color exist and font color not exist" do
@process = build(:legislation_process, background_color: "#944949", font_color: "")
expect(banner_color?).to eq(false)
expect(banner_color?).to be false
end
it "background color not exist and font color exist" do
@process = build(:legislation_process, background_color: "", font_color: "#944949")
expect(banner_color?).to eq(false)
expect(banner_color?).to be false
end
it "background and font color not exist" do
@process = build(:legislation_process, background_color: "", font_color: "")
expect(banner_color?).to eq(false)
expect(banner_color?).to be false
end
end
end

View File

@@ -8,7 +8,7 @@ RSpec.describe SettingsHelper, type: :helper do
expect(setting["key1"]).to eq("value1")
expect(setting["key2"]).to eq("value2")
expect(setting["key3"]).to eq(nil)
expect(setting["key3"]).to be nil
end
end
@@ -19,9 +19,9 @@ RSpec.describe SettingsHelper, type: :helper do
Setting["feature.f3"] = nil
expect(feature?("f1")).to eq("active")
expect(feature?("f2")).to eq(nil)
expect(feature?("f3")).to eq(nil)
expect(feature?("f4")).to eq(nil)
expect(feature?("f2")).to be nil
expect(feature?("f3")).to be nil
expect(feature?("f4")).to be nil
end
end