Browse Source

test: update tests

pull/893/head
natdeanlewissoftwire 2 years ago
parent
commit
ee59341c9d
  1. 2
      spec/models/form/sales/subsections/setup_spec.rb
  2. 4
      spec/models/form_handler_spec.rb
  3. 4
      spec/models/form_spec.rb

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

@ -13,7 +13,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do
it "has correct pages" do
expect(setup.pages.map(&:id)).to eq(
%w[organisation created_by completion_date purchaser_code ownership_scheme shared_ownership_type discounted_ownership_type outright_ownership_type buyer_live joint_purchase number_joint_buyers builtype],
%w[organisation created_by completion_date purchaser_code ownership_scheme shared_ownership_type discounted_ownership_type outright_ownership_type buyer_company buyer_live joint_purchase number_joint_buyers builtype],
)
end

4
spec/models/form_handler_spec.rb

@ -61,14 +61,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(19)
expect(form.pages.count).to eq(20)
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(19)
expect(form.pages.count).to eq(20)
expect(form.name).to eq("2021_2022_sales")
end
end

4
spec/models/form_spec.rb

@ -218,9 +218,9 @@ RSpec.describe Form, type: :model do
expect(form.sections[0].class).to eq(Form::Sales::Sections::Setup)
expect(form.subsections.count).to eq(1)
expect(form.subsections.first.id).to eq("setup")
expect(form.pages.count).to eq(12)
expect(form.pages.count).to eq(13)
expect(form.pages.first.id).to eq("organisation")
expect(form.questions.count).to eq(13)
expect(form.questions.count).to eq(14)
expect(form.questions.first.id).to eq("owning_organisation_id")
expect(form.start_date).to eq(Time.zone.parse("2022-04-01"))
expect(form.end_date).to eq(Time.zone.parse("2023-07-01"))

Loading…
Cancel
Save