Browse Source

Test income refused derivation

pull/109/head
baarkerlounger 4 years ago
parent
commit
e901476b0d
  1. 1
      app/models/case_log.rb
  2. 8
      spec/models/case_log_spec.rb

1
app/models/case_log.rb

@ -113,6 +113,7 @@ class CaseLog < ApplicationRecord
enum first_time_property_let_as_social_housing: DbEnums.polar, _suffix: true enum first_time_property_let_as_social_housing: DbEnums.polar, _suffix: true
enum unitletas: DbEnums.unitletas, _suffix: true enum unitletas: DbEnums.unitletas, _suffix: true
enum builtype: DbEnums.builtype, _suffix: true enum builtype: DbEnums.builtype, _suffix: true
enum incref: DbEnums.polar, _suffix: true
AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze
OPTIONAL_FIELDS = %w[do_you_know_the_postcode OPTIONAL_FIELDS = %w[do_you_know_the_postcode

8
spec/models/case_log_spec.rb

@ -424,6 +424,14 @@ RSpec.describe Form, type: :model do
end end
end end
describe "incref" do
let(:case_log) { FactoryBot.build(:case_log, net_income_known: "Prefer not to say") }
it "sets income refused to Yes" do
expect(case_log.incref).to eq(1)
end
end
describe "weekly_net_income" do describe "weekly_net_income" do
let(:net_income) { 5000 } let(:net_income) { 5000 }
let(:case_log) { FactoryBot.build(:case_log, earnings: net_income) } let(:case_log) { FactoryBot.build(:case_log, earnings: net_income) }

Loading…
Cancel
Save