Browse Source

Add answer options to the gender question

pull/902/head
Kat 3 years ago
parent
commit
0d8aedc350
  1. 8
      app/models/form/sales/questions/gender_identity1.rb
  2. 9
      spec/models/form/sales/questions/gender_identity1_spec.rb

8
app/models/form/sales/questions/gender_identity1.rb

@ -7,5 +7,13 @@ class Form::Sales::Questions::GenderIdentity1 < ::Form::Question
@type = "radio"
@hint_text = "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest."
@page = page
@answer_options = ANSWER_OPTIONS
end
ANSWER_OPTIONS = {
"F" => { "value" => "Female" },
"M" => { "value" => "Male" },
"X" => { "value" => "Non-binary" },
"R" => { "value" => "Prefers not to say " },
}.freeze
end

9
spec/models/form/sales/questions/gender_identity1_spec.rb

@ -34,4 +34,13 @@ RSpec.describe Form::Sales::Questions::GenderIdentity1, type: :model do
it "has the correct hint" do
expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.")
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"F" => { "value" => "Female" },
"M" => { "value" => "Male" },
"X" => { "value" => "Non-binary" },
"R" => { "value" => "Prefers not to say " },
})
end
end

Loading…
Cancel
Save