Browse Source

Add specs

pull/901/head
Kat 3 years ago
parent
commit
fc099b7030
  1. 29
      spec/models/form/sales/sections/household_spec.rb
  2. 29
      spec/models/form/sales/sections/property_information_spec.rb
  3. 27
      spec/models/form/sales/subsections/household_characteristics_spec.rb
  4. 27
      spec/models/form/sales/subsections/property_information_spec.rb

29
spec/models/form/sales/sections/household_spec.rb

@ -0,0 +1,29 @@
require "rails_helper"
RSpec.describe Form::Sales::Sections::Household, type: :model do
subject(:setup) { described_class.new(section_id, section_definition, form) }
let(:section_id) { nil }
let(:section_definition) { nil }
let(:form) { instance_double(Form) }
it "has correct form" do
expect(setup.form).to eq(form)
end
it "has correct subsections" do
expect(setup.subsections.map(&:id)).to eq(%w[household_characteristics])
end
it "has the correct id" do
expect(setup.id).to eq("household")
end
it "has the correct label" do
expect(setup.label).to eq("About the household")
end
it "has the correct description" do
expect(setup.description).to eq("")
end
end

29
spec/models/form/sales/sections/property_information_spec.rb

@ -0,0 +1,29 @@
require "rails_helper"
RSpec.describe Form::Sales::Sections::PropertyInformation, type: :model do
subject(:setup) { described_class.new(section_id, section_definition, form) }
let(:section_id) { nil }
let(:section_definition) { nil }
let(:form) { instance_double(Form) }
it "has correct form" do
expect(setup.form).to eq(form)
end
it "has correct subsections" do
expect(setup.subsections.map(&:id)).to eq(%w[property_information])
end
it "has the correct id" do
expect(setup.id).to eq("property_information")
end
it "has the correct label" do
expect(setup.label).to eq("Property information")
end
it "has the correct description" do
expect(setup.description).to eq("")
end
end

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

@ -0,0 +1,27 @@
require "rails_helper"
RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model do
subject(:setup) { described_class.new(subsection_id, subsection_definition, section) }
let(:subsection_id) { nil }
let(:subsection_definition) { nil }
let(:section) { instance_double(Form::Sales::Sections::Setup) }
it "has correct section" do
expect(setup.section).to eq(section)
end
it "has correct pages" do
expect(setup.pages.map(&:id)).to eq(
%w[buyer_1_age],
)
end
it "has the correct id" do
expect(setup.id).to eq("household_characteristics")
end
it "has the correct label" do
expect(setup.label).to eq("Household characteristics")
end
end

27
spec/models/form/sales/subsections/property_information_spec.rb

@ -0,0 +1,27 @@
require "rails_helper"
RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do
subject(:setup) { described_class.new(subsection_id, subsection_definition, section) }
let(:subsection_id) { nil }
let(:subsection_definition) { nil }
let(:section) { instance_double(Form::Sales::Sections::PropertyInformation) }
it "has correct section" do
expect(setup.section).to eq(section)
end
it "has correct pages" do
expect(setup.pages.map(&:id)).to eq(
%w[property_number_of_bedrooms],
)
end
it "has the correct id" do
expect(setup.id).to eq("property_information")
end
it "has the correct label" do
expect(setup.label).to eq("Property information")
end
end
Loading…
Cancel
Save