Browse Source

Update names in tests 🫠

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

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

@ -1,29 +1,29 @@
require "rails_helper"
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_definition) { nil }
let(:form) { instance_double(Form) }
it "has correct form" do
expect(setup.form).to eq(form)
expect(household.form).to eq(form)
end
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
it "has the correct id" do
expect(setup.id).to eq("household")
expect(household.id).to eq("household")
end
it "has the correct label" do
expect(setup.label).to eq("About the household")
expect(household.label).to eq("About the household")
end
it "has the correct description" do
expect(setup.description).to eq("")
expect(household.description).to eq("")
end
end

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

@ -1,29 +1,29 @@
require "rails_helper"
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_definition) { nil }
let(:form) { instance_double(Form) }
it "has correct form" do
expect(setup.form).to eq(form)
expect(property_information.form).to eq(form)
end
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
it "has the correct id" do
expect(setup.id).to eq("property_information")
expect(property_information.id).to eq("property_information")
end
it "has the correct label" do
expect(setup.label).to eq("Property information")
expect(property_information.label).to eq("Property information")
end
it "has the correct description" do
expect(setup.description).to eq("")
expect(property_information.description).to eq("")
end
end

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

@ -1,27 +1,27 @@
require "rails_helper"
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_definition) { nil }
let(:section) { instance_double(Form::Sales::Sections::Setup) }
let(:section) { instance_double(Form::Sales::Sections::Household) }
it "has correct section" do
expect(setup.section).to eq(section)
expect(household_characteristics.section).to eq(section)
end
it "has correct pages" do
expect(setup.pages.map(&:id)).to eq(
expect(household_characteristics.pages.map(&:id)).to eq(
%w[buyer_1_age],
)
end
it "has the correct id" do
expect(setup.id).to eq("household_characteristics")
expect(household_characteristics.id).to eq("household_characteristics")
end
it "has the correct label" do
expect(setup.label).to eq("Household characteristics")
expect(household_characteristics.label).to eq("Household characteristics")
end
end

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

@ -1,27 +1,27 @@
require "rails_helper"
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_definition) { nil }
let(:section) { instance_double(Form::Sales::Sections::PropertyInformation) }
it "has correct section" do
expect(setup.section).to eq(section)
expect(property_information.section).to eq(section)
end
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],
)
end
it "has the correct id" do
expect(setup.id).to eq("property_information")
expect(property_information.id).to eq("property_information")
end
it "has the correct label" do
expect(setup.label).to eq("Property information")
expect(property_information.label).to eq("Property information")
end
end

Loading…
Cancel
Save