4 changed files with 112 additions and 0 deletions
@ -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 |
@ -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 |
@ -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 |
@ -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…
Reference in new issue