Browse Source

fix tests

pull/234/head
Kat 4 years ago
parent
commit
0c90b6b894
  1. 17
      spec/fixtures/forms/2021_2022.json
  2. 2
      spec/helpers/question_attribute_helper_spec.rb
  3. 2
      spec/models/form_handler_spec.rb

17
spec/fixtures/forms/2021_2022.json vendored

@ -541,6 +541,23 @@
"requires_js": true
}
}
},
"weekly_net_income": {
"header": "",
"description": "",
"questions": {
"earnings": {
"check_answer_label": "Total household income",
"header": "How much income does the household have in total every week?",
"hint_text": "",
"type": "numeric",
"min": 0,
"step": "1",
"width": 5,
"prefix": "£",
"suffix": " every week"
}
}
}
}
}

2
spec/helpers/question_attribute_helper_spec.rb

@ -7,7 +7,7 @@ RSpec.describe QuestionAttributeHelper do
describe "html attributes" do
it "returns empty hash if fields-to-add or result-field are empty " do
question = questions.find { |q| q.id == "tcharge" }
question = form.get_page("weekly_net_income").questions.find { |q| q.id == "earnings" }
expect(stimulus_html_attributes(question)).to eq({})
end

2
spec/models/form_handler_spec.rb

@ -16,7 +16,7 @@ RSpec.describe FormHandler do
form_handler = FormHandler.instance
form = form_handler.get_form(test_form_name)
expect(form).to be_a(Form)
expect(form.pages.count).to eq(28)
expect(form.pages.count).to eq(29)
end
end

Loading…
Cancel
Save