10 changed files with 85 additions and 6 deletions
@ -0,0 +1,16 @@
|
||||
class Form::Sales::Pages::Age1 < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "buyer_1_age" |
||||
@header = "" |
||||
@description = "" |
||||
@subsection = subsection |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::Buyer1AgeKnown.new(nil, nil, self), |
||||
Form::Sales::Questions::Age1.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,10 @@
|
||||
class Form::Sales::Sections::Household < ::Form::Section |
||||
def initialize(id, hsh, form) |
||||
super |
||||
@id = "household" |
||||
@label = "About the household" |
||||
@description = "" |
||||
@form = form |
||||
@subsections = [Form::Sales::Subsections::HouseholdCharacteristics.new(nil, nil, self)] || [] |
||||
end |
||||
end |
@ -0,0 +1,14 @@
|
||||
class Form::Sales::Subsections::HouseholdCharacteristics < ::Form::Subsection |
||||
def initialize(id, hsh, section) |
||||
super |
||||
@id = "household_characteristics" |
||||
@label = "Household characteristics" |
||||
@section = section |
||||
end |
||||
|
||||
def pages |
||||
@pages ||= [ |
||||
Form::Sales::Pages::Age1.new(nil, nil, self), |
||||
] |
||||
end |
||||
end |
@ -0,0 +1,33 @@
|
||||
require "rails_helper" |
||||
|
||||
RSpec.describe Form::Sales::Pages::Age1, type: :model do |
||||
subject(:page) { described_class.new(page_id, page_definition, subsection) } |
||||
|
||||
let(:page_id) { nil } |
||||
let(:page_definition) { nil } |
||||
let(:subsection) { instance_double(Form::Subsection) } |
||||
|
||||
it "has correct subsection" do |
||||
expect(page.subsection).to eq(subsection) |
||||
end |
||||
|
||||
it "has correct questions" do |
||||
expect(page.questions.map(&:id)).to eq(%w[age1_known age1]) |
||||
end |
||||
|
||||
it "has the correct id" do |
||||
expect(page.id).to eq("buyer_1_age") |
||||
end |
||||
|
||||
it "has the correct header" do |
||||
expect(page.header).to eq("") |
||||
end |
||||
|
||||
it "has the correct description" do |
||||
expect(page.description).to eq("") |
||||
end |
||||
|
||||
it "has correct depends_on" do |
||||
expect(page.depends_on).to be_nil |
||||
end |
||||
end |
Loading…
Reference in new issue