Browse Source

tests: update tests

CLDC-1528-person-1-relationship-to-buyer-1
natdeanlewissoftwire 2 years ago
parent
commit
cab5248421
  1. 1
      spec/factories/sales_log.rb
  2. 2
      spec/models/form/sales/pages/person1_known_spec.rb
  3. 6
      spec/models/form/sales/pages/person2_known_spec.rb
  4. 4
      spec/models/form/sales/pages/person3_known_spec.rb
  5. 2
      spec/models/form/sales/pages/person4_known_spec.rb
  6. 2
      spec/models/form/sales/questions/person1_gender_identity_spec.rb
  7. 2
      spec/models/form/sales/subsections/household_characteristics_spec.rb
  8. 4
      spec/models/form_handler_spec.rb

1
spec/factories/sales_log.rb

@ -40,6 +40,7 @@ FactoryBot.define do
hholdcount { "1" }
wheel { 1 }
details_known_1 { 1 }
relat3 { "P" }
age3_known { 0 }
age3 { 40 }
details_known_2 { 1 }

2
spec/models/form/sales/pages/person1_known_spec.rb

@ -24,7 +24,7 @@ RSpec.describe Form::Sales::Pages::Person1Known, type: :model do
end
it "has the correct header_partial" do
expect(page.header_partial).to eq("person_1_known_page")
expect(page.header_partial).to eq(nil)
end
it "has the correct description" do

6
spec/models/form/sales/pages/person2_known_spec.rb

@ -34,9 +34,9 @@ RSpec.describe Form::Sales::Pages::Person2Known, type: :model do
it "has correct depends_on" do
expect(page.depends_on).to eq(
[
{ "hholdcount" => 2, "details_known_1" => 1 },
{ "hholdcount" => 3, "details_known_1" => 1 },
{ "hholdcount" => 4, "details_known_1" => 1 },
{ "hholdcount" => 2 },
{ "hholdcount" => 3 },
{ "hholdcount" => 4 },
],
)
end

4
spec/models/form/sales/pages/person3_known_spec.rb

@ -34,8 +34,8 @@ RSpec.describe Form::Sales::Pages::Person3Known, type: :model do
it "has correct depends_on" do
expect(page.depends_on).to eq(
[
{ "details_known_2" => 1, "hholdcount" => 3 },
{ "details_known_2" => 1, "hholdcount" => 4 },
{ "hholdcount" => 3 },
{ "hholdcount" => 4 },
],
)
end

2
spec/models/form/sales/pages/person4_known_spec.rb

@ -34,7 +34,7 @@ RSpec.describe Form::Sales::Pages::Person4Known, type: :model do
it "has correct depends_on" do
expect(page.depends_on).to eq(
[
{ "details_known_3" => 1, "hholdcount" => 4 },
{ "hholdcount" => 4 },
],
)
end

2
spec/models/form/sales/questions/person1_gender_identity_spec.rb

@ -32,7 +32,7 @@ RSpec.describe Form::Sales::Questions::Person1GenderIdentity, type: :model do
end
it "has expected check answers card number" do
expect(question.check_answers_card_number).to eq(2)
expect(question.check_answers_card_number).to eq(3)
end
it "has the correct answer_options" do

2
spec/models/form/sales/subsections/household_characteristics_spec.rb

@ -34,6 +34,8 @@ RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model
buyer_2_live_in_property
number_of_others_in_property
person_1_known
person_1_relationship_to_buyer_1
person_1_relationship_to_buyer_1_joint_purchase
person_1_age
person_1_gender_identity
person_1_gender_identity_joint_purchase

4
spec/models/form_handler_spec.rb

@ -52,14 +52,14 @@ RSpec.describe FormHandler do
it "is able to load a current sales form" do
form = form_handler.get_form("current_sales")
expect(form).to be_a(Form)
expect(form.pages.count).to eq(51)
expect(form.pages.count).to eq(53)
expect(form.name).to eq("2022_2023_sales")
end
it "is able to load a previous sales form" do
form = form_handler.get_form("previous_sales")
expect(form).to be_a(Form)
expect(form.pages.count).to eq(51)
expect(form.pages.count).to eq(53)
expect(form.name).to eq("2021_2022_sales")
end
end

Loading…
Cancel
Save