From a873787663679b5d532200ec9ddbd316e4dc25fc Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Fri, 22 Oct 2021 15:16:57 +0100 Subject: [PATCH] Match values --- db/seeds.rb | 24 ++++++++++++------------ spec/factories/income_range.rb | 4 ++-- spec/models/case_log_spec.rb | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 00bd285eb..28a19fad3 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,20 +5,20 @@ # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Character.create(name: 'Luke', movie: movies.first) -AdminUser.create!(email: "admin@example.com", password: "password", password_confirmation: "password") if Rails.env.development? +# AdminUser.create!(email: "admin@example.com", password: "password", password_confirmation: "password") if Rails.env.development? income_ranges = [ - { economic_status: "full_time", soft_min: 143, soft_max: 730, hard_min: 90, hard_max: 1230 }, - { economic_status: "part_time", soft_min: 67, soft_max: 620, hard_min: 50, hard_max: 950 }, - { economic_status: "gov_training", soft_min: 80, soft_max: 480, hard_min: 40, hard_max: 990 }, - { economic_status: "job_seeker", soft_min: 50, soft_max: 370, hard_min: 10, hard_max: 450 }, - { economic_status: "retired", soft_min: 50, soft_max: 380, hard_min: 10, hard_max: 690 }, - { economic_status: "not_seeking_work", soft_min: 53, soft_max: 540, hard_min: 10, hard_max: 890 }, - { economic_status: "full_time_student", soft_min: 47, soft_max: 460, hard_min: 10, hard_max: 1300 }, - { economic_status: "unable_to_work", soft_min: 54, soft_max: 460, hard_min: 10, hard_max: 820 }, - { economic_status: "child_under_16", soft_min: 50, soft_max: 450, hard_min: 10, hard_max: 750 }, - { economic_status: "other_adult", soft_min: 50, soft_max: 580, hard_min: 10, hard_max: 1040 }, - { economic_status: "refused", soft_min: 47, soft_max: 730, hard_min: 10, hard_max: 1300 }, + { economic_status: "Full-time - 30 hours or more", soft_min: 143, soft_max: 730, hard_min: 90, hard_max: 1230 }, + { economic_status: "Part-time - Less than 30 hours", soft_min: 67, soft_max: 620, hard_min: 50, hard_max: 950 }, + { economic_status: "In government training into work, such as New Deal", soft_min: 80, soft_max: 480, hard_min: 40, hard_max: 990 }, + { economic_status: "Jobseeker", soft_min: 50, soft_max: 370, hard_min: 10, hard_max: 450 }, + { economic_status: "Retired", soft_min: 50, soft_max: 380, hard_min: 10, hard_max: 690 }, + { economic_status: "Not seeking work", soft_min: 53, soft_max: 540, hard_min: 10, hard_max: 890 }, + { economic_status: "Full-time student", soft_min: 47, soft_max: 460, hard_min: 10, hard_max: 1300 }, + { economic_status: "Unable to work because of long term sick or disability", soft_min: 54, soft_max: 460, hard_min: 10, hard_max: 820 }, + { economic_status: "Child under 16", soft_min: 50, soft_max: 450, hard_min: 10, hard_max: 750 }, + { economic_status: "Other", soft_min: 50, soft_max: 580, hard_min: 10, hard_max: 1040 }, + { economic_status: "Prefer not to say", soft_min: 47, soft_max: 730, hard_min: 10, hard_max: 1300 }, ] income_ranges.each do |income_range| diff --git a/spec/factories/income_range.rb b/spec/factories/income_range.rb index 1bbb5a4ee..188554512 100644 --- a/spec/factories/income_range.rb +++ b/spec/factories/income_range.rb @@ -2,14 +2,14 @@ FactoryBot.define do factory :income_range do sequence(:id) { |i| i } trait :full_time do - economic_status { "full_time" } + economic_status { "Full-time - 30 hours or more" } soft_min { 143 } soft_max { 730 } hard_min { 90 } hard_max { 1230 } end trait :retired do - economic_status { "retired" } + economic_status { "Retired" } soft_min { 50 } soft_max { 370 } hard_min { 10 } diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index 2c301b5a0..c33764ad9 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -32,7 +32,7 @@ RSpec.describe Form, type: :model do it "validates net income maximum" do expect { CaseLog.create!( - tenant_economic_status: "full_time", + tenant_economic_status: "Full-time - 30 hours or more", net_income: 5000, net_income_frequency: "Weekly" ) }.to raise_error(ActiveRecord::RecordInvalid)