Browse Source

Add gender identity 1 page

pull/902/head
Kat 3 years ago
parent
commit
1f31d574b1
  1. 15
      app/models/form/sales/pages/gender_identity_1.rb
  2. 33
      spec/models/form/sales/pages/gender_identity_1_spec.rb

15
app/models/form/sales/pages/gender_identity_1.rb

@ -0,0 +1,15 @@
class Form::Sales::Pages::GenderIdentity1 < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_1_gender_identity"
@header = ""
@description = ""
@subsection = subsection
end
def questions
@questions ||= [
Form::Sales::Questions::GenderIdentity1.new(nil, nil, self),
]
end
end

33
spec/models/form/sales/pages/gender_identity_1_spec.rb

@ -0,0 +1,33 @@
require "rails_helper"
RSpec.describe Form::Sales::Pages::GenderIdentity1, 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[sex1])
end
it "has the correct id" do
expect(page.id).to eq("buyer_1_gender_identity")
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…
Cancel
Save