Adds sanitized descriptions for all phases to budget model

This commit is contained in:
kikito
2017-01-01 12:51:17 +01:00
parent c17dcf1bab
commit d80dedaad8
5 changed files with 49 additions and 7 deletions

View File

@@ -1,6 +1,19 @@
require 'rails_helper'
describe Budget do
describe "description" do
it "changes depending on the phase" do
budget = create(:budget)
Budget::VALID_PHASES.each do |phase|
budget.phase = phase
expect(budget.description).to eq(budget.send("description_#{phase}"))
expect(budget.description).to be_html_safe
end
end
end
describe "phase" do
let(:budget) { create(:budget) }