4 changed files with 23 additions and 23 deletions
@ -1,29 +1,29 @@ |
|||||||
require "rails_helper" |
require "rails_helper" |
||||||
|
|
||||||
RSpec.describe Form::Sales::Sections::Household, type: :model do |
RSpec.describe Form::Sales::Sections::Household, type: :model do |
||||||
subject(:setup) { described_class.new(section_id, section_definition, form) } |
subject(:household) { described_class.new(section_id, section_definition, form) } |
||||||
|
|
||||||
let(:section_id) { nil } |
let(:section_id) { nil } |
||||||
let(:section_definition) { nil } |
let(:section_definition) { nil } |
||||||
let(:form) { instance_double(Form) } |
let(:form) { instance_double(Form) } |
||||||
|
|
||||||
it "has correct form" do |
it "has correct form" do |
||||||
expect(setup.form).to eq(form) |
expect(household.form).to eq(form) |
||||||
end |
end |
||||||
|
|
||||||
it "has correct subsections" do |
it "has correct subsections" do |
||||||
expect(setup.subsections.map(&:id)).to eq(%w[household_characteristics]) |
expect(household.subsections.map(&:id)).to eq(%w[household_characteristics]) |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct id" do |
it "has the correct id" do |
||||||
expect(setup.id).to eq("household") |
expect(household.id).to eq("household") |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct label" do |
it "has the correct label" do |
||||||
expect(setup.label).to eq("About the household") |
expect(household.label).to eq("About the household") |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct description" do |
it "has the correct description" do |
||||||
expect(setup.description).to eq("") |
expect(household.description).to eq("") |
||||||
end |
end |
||||||
end |
end |
||||||
|
|||||||
@ -1,29 +1,29 @@ |
|||||||
require "rails_helper" |
require "rails_helper" |
||||||
|
|
||||||
RSpec.describe Form::Sales::Sections::PropertyInformation, type: :model do |
RSpec.describe Form::Sales::Sections::PropertyInformation, type: :model do |
||||||
subject(:setup) { described_class.new(section_id, section_definition, form) } |
subject(:property_information) { described_class.new(section_id, section_definition, form) } |
||||||
|
|
||||||
let(:section_id) { nil } |
let(:section_id) { nil } |
||||||
let(:section_definition) { nil } |
let(:section_definition) { nil } |
||||||
let(:form) { instance_double(Form) } |
let(:form) { instance_double(Form) } |
||||||
|
|
||||||
it "has correct form" do |
it "has correct form" do |
||||||
expect(setup.form).to eq(form) |
expect(property_information.form).to eq(form) |
||||||
end |
end |
||||||
|
|
||||||
it "has correct subsections" do |
it "has correct subsections" do |
||||||
expect(setup.subsections.map(&:id)).to eq(%w[property_information]) |
expect(property_information.subsections.map(&:id)).to eq(%w[property_information]) |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct id" do |
it "has the correct id" do |
||||||
expect(setup.id).to eq("property_information") |
expect(property_information.id).to eq("property_information") |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct label" do |
it "has the correct label" do |
||||||
expect(setup.label).to eq("Property information") |
expect(property_information.label).to eq("Property information") |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct description" do |
it "has the correct description" do |
||||||
expect(setup.description).to eq("") |
expect(property_information.description).to eq("") |
||||||
end |
end |
||||||
end |
end |
||||||
|
|||||||
@ -1,27 +1,27 @@ |
|||||||
require "rails_helper" |
require "rails_helper" |
||||||
|
|
||||||
RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model do |
RSpec.describe Form::Sales::Subsections::HouseholdCharacteristics, type: :model do |
||||||
subject(:setup) { described_class.new(subsection_id, subsection_definition, section) } |
subject(:household_characteristics) { described_class.new(subsection_id, subsection_definition, section) } |
||||||
|
|
||||||
let(:subsection_id) { nil } |
let(:subsection_id) { nil } |
||||||
let(:subsection_definition) { nil } |
let(:subsection_definition) { nil } |
||||||
let(:section) { instance_double(Form::Sales::Sections::Setup) } |
let(:section) { instance_double(Form::Sales::Sections::Household) } |
||||||
|
|
||||||
it "has correct section" do |
it "has correct section" do |
||||||
expect(setup.section).to eq(section) |
expect(household_characteristics.section).to eq(section) |
||||||
end |
end |
||||||
|
|
||||||
it "has correct pages" do |
it "has correct pages" do |
||||||
expect(setup.pages.map(&:id)).to eq( |
expect(household_characteristics.pages.map(&:id)).to eq( |
||||||
%w[buyer_1_age], |
%w[buyer_1_age], |
||||||
) |
) |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct id" do |
it "has the correct id" do |
||||||
expect(setup.id).to eq("household_characteristics") |
expect(household_characteristics.id).to eq("household_characteristics") |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct label" do |
it "has the correct label" do |
||||||
expect(setup.label).to eq("Household characteristics") |
expect(household_characteristics.label).to eq("Household characteristics") |
||||||
end |
end |
||||||
end |
end |
||||||
|
|||||||
@ -1,27 +1,27 @@ |
|||||||
require "rails_helper" |
require "rails_helper" |
||||||
|
|
||||||
RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do |
RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do |
||||||
subject(:setup) { described_class.new(subsection_id, subsection_definition, section) } |
subject(:property_information) { described_class.new(subsection_id, subsection_definition, section) } |
||||||
|
|
||||||
let(:subsection_id) { nil } |
let(:subsection_id) { nil } |
||||||
let(:subsection_definition) { nil } |
let(:subsection_definition) { nil } |
||||||
let(:section) { instance_double(Form::Sales::Sections::PropertyInformation) } |
let(:section) { instance_double(Form::Sales::Sections::PropertyInformation) } |
||||||
|
|
||||||
it "has correct section" do |
it "has correct section" do |
||||||
expect(setup.section).to eq(section) |
expect(property_information.section).to eq(section) |
||||||
end |
end |
||||||
|
|
||||||
it "has correct pages" do |
it "has correct pages" do |
||||||
expect(setup.pages.map(&:id)).to eq( |
expect(property_information.pages.map(&:id)).to eq( |
||||||
%w[property_number_of_bedrooms], |
%w[property_number_of_bedrooms], |
||||||
) |
) |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct id" do |
it "has the correct id" do |
||||||
expect(setup.id).to eq("property_information") |
expect(property_information.id).to eq("property_information") |
||||||
end |
end |
||||||
|
|
||||||
it "has the correct label" do |
it "has the correct label" do |
||||||
expect(setup.label).to eq("Property information") |
expect(property_information.label).to eq("Property information") |
||||||
end |
end |
||||||
end |
end |
||||||
|
|||||||
Loading…
Reference in new issue