Fix conflicts with merged branch, Budget::PHASES have moved, and described_class usage is a must

This commit is contained in:
Bertocq
2018-01-16 18:44:21 +01:00
parent d44db9cec4
commit 8b469c5d98

View File

@@ -123,13 +123,13 @@ describe Budget do
it "returns nil if there is only one budget and it is still in drafting phase" do
budget = create(:budget, phase: "drafting")
expect(Budget.current).to eq(nil)
expect(described_class.current).to eq(nil)
end
it "returns the budget if there is only one and not in drafting phase" do
budget = create(:budget, phase: "accepting")
expect(Budget.current).to eq(budget)
expect(described_class.current).to eq(budget)
end
it "returns the last budget created that is not in drafting phase" do
@@ -138,7 +138,7 @@ describe Budget do
current_budget = create(:budget, phase: "accepting", created_at: 1.month.ago)
next_budget = create(:budget, phase: "drafting", created_at: 1.week.ago)
expect(Budget.current).to eq(current_budget)
expect(described_class.current).to eq(current_budget)
end
end
@@ -146,10 +146,9 @@ describe Budget do
describe "#open" do
it "returns all budgets that are not in the finished phase" do
phases = Budget::PHASES - ["finished"]
phases.each do |phase|
(Budget::Phase::PHASE_KINDS - ["finished"]).each do |phase|
budget = create(:budget, phase: phase)
expect(Budget.open).to include(budget)
expect(described_class.open).to include(budget)
end
end