From b462dc8728f0916c16056d787c03e3ebf73ce5af Mon Sep 17 00:00:00 2001 From: Ted-U <92022120+Ted-U@users.noreply.github.com> Date: Fri, 23 Sep 2022 10:16:49 +0100 Subject: [PATCH] add tests to form spec --- spec/models/form_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/models/form_spec.rb b/spec/models/form_spec.rb index c9d2a3f36..b592c31c5 100644 --- a/spec/models/form_spec.rb +++ b/spec/models/form_spec.rb @@ -225,5 +225,14 @@ RSpec.describe Form, type: :model do expect(form.start_date).to eq(Time.zone.parse("2022-04-01")) expect(form.end_date).to eq(Time.zone.parse("2023-07-01")) end + + it "can correctly define sections in the sales form" do + sections = [Form::Sales::Property::Sections::PropertyInformation] + form = described_class.new(nil, 2022, sections, "sales") + expect(form.type).to eq("sales") + expect(form.name).to eq("2022_2023_sales") + expect(form.sections.count).to eq(2) + expect(form.sections[1].class).to eq(Form::Sales::Property::Sections::PropertyInformation) + end end end