Use budget phase traits

We were already using them in many places, but not everywhere.
This commit is contained in:
Javi Martín
2019-09-21 16:48:35 +02:00
parent cced12c3a0
commit aeb1655961
15 changed files with 51 additions and 51 deletions

View File

@@ -5,10 +5,10 @@ describe ApplicationController do
describe "#current_budget" do
it "returns the last budget that is not in draft phase" do
old_budget = create(:budget, phase: "finished", created_at: 2.years.ago)
previous_budget = create(:budget, phase: "accepting", created_at: 1.year.ago)
current_budget = create(:budget, phase: "accepting", created_at: 1.month.ago)
next_budget = create(:budget, phase: "drafting", created_at: 1.week.ago)
old_budget = create(:budget, :finished, created_at: 2.years.ago)
previous_budget = create(:budget, :accepting, created_at: 1.year.ago)
current_budget = create(:budget, :accepting, created_at: 1.month.ago)
next_budget = create(:budget, :drafting, created_at: 1.week.ago)
budget = subject.instance_eval { current_budget }
expect(budget).to eq(current_budget)