|
|
|
@ -14,4 +14,21 @@ RSpec.describe Form, type: :model do
|
|
|
|
|
expect { CaseLog.create!(tenant_age: 0) }.to raise_error(ActiveRecord::RecordInvalid) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "status" do |
|
|
|
|
let!(:empty_case_log) { FactoryBot.create(:case_log) } |
|
|
|
|
let!(:in_progress_case_log) { FactoryBot.create(:case_log, :in_progress) } |
|
|
|
|
|
|
|
|
|
it "is set to not started for an empty case log" do |
|
|
|
|
expect(empty_case_log.not_started?).to be(true) |
|
|
|
|
expect(empty_case_log.in_progress?).to be(false) |
|
|
|
|
expect(empty_case_log.completed?).to be(false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "is set to not started for an empty case log" do |
|
|
|
|
expect(in_progress_case_log.in_progress?).to be(true) |
|
|
|
|
expect(in_progress_case_log.not_started?).to be(false) |
|
|
|
|
expect(in_progress_case_log.completed?).to be(false) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|