Files
nairobi/spec/controllers/application_controller_spec.rb
Javi Martín f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00

20 lines
613 B
Ruby

require "rails_helper"
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)
budget = subject.instance_eval { current_budget }
expect(budget).to eq(current_budget)
end
end
end