diff --git a/.rubocop.yml b/.rubocop.yml index 7b3dbb3c8..f4dfe5482 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -324,6 +324,9 @@ RSpec/EmptyExampleGroup: Exclude: - spec/factories/**/* +RSpec/EmptyLineAfterExample: + Enabled: true + RSpec/EmptyLineAfterExampleGroup: Enabled: true Exclude: diff --git a/spec/models/budget_spec.rb b/spec/models/budget_spec.rb index 7a8a37e9d..05b63c586 100644 --- a/spec/models/budget_spec.rb +++ b/spec/models/budget_spec.rb @@ -217,6 +217,7 @@ describe Budget do budget.phase = "reviewing" expect(budget.investments_orders).to eq(["random"]) end + it "is random and price when ballotting and reviewing ballots" do budget.phase = "publishing_prices" expect(budget.investments_orders).to eq(["random", "price"]) @@ -225,6 +226,7 @@ describe Budget do budget.phase = "reviewing_ballots" expect(budget.investments_orders).to eq(["random", "price"]) end + it "is random and confidence_score in all other cases" do budget.phase = "selecting" expect(budget.investments_orders).to eq(["random", "confidence_score"]) diff --git a/spec/models/organization_spec.rb b/spec/models/organization_spec.rb index 4ae9cdb36..82f827960 100644 --- a/spec/models/organization_spec.rb +++ b/spec/models/organization_spec.rb @@ -7,15 +7,18 @@ describe Organization do it "is false when verified_at? is blank" do expect(subject.verified?).to be false end + it "is true when verified_at? exists" do subject.verified_at = Time.current expect(subject.verified?).to be true end + it "is false when the organization was verified and then rejected" do subject.verified_at = Time.current subject.rejected_at = Time.current + 1 expect(subject.verified?).to be false end + it "is true when the organization was rejected and then verified" do subject.rejected_at = Time.current subject.verified_at = Time.current + 1 @@ -27,15 +30,18 @@ describe Organization do it "is false when rejected_at? is blank" do expect(subject.rejected?).to be false end + it "is true when rejected_at? exists" do subject.rejected_at = Time.current expect(subject.rejected?).to be true end + it "is true when the organization was verified and then rejected" do subject.verified_at = Time.current subject.rejected_at = Time.current + 1 expect(subject.rejected?).to be true end + it "is false when the organization was rejected and then verified" do subject.rejected_at = Time.current subject.verified_at = Time.current + 1