Browse Source

Add a test for the partial being rendered

pull/192/head
baarkerlounger 3 years ago
parent
commit
98dbf67c2e
  1. 1
      spec/fixtures/forms/2021_2022.json
  2. 7
      spec/requests/form_controller_spec.rb

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

@ -367,6 +367,7 @@
"earnings": { "earnings": {
"check_answer_label": "Income", "check_answer_label": "Income",
"header": "What is the tenant’s /and partner’s combined income after tax?", "header": "What is the tenant’s /and partner’s combined income after tax?",
"guidance_partial": "what_counts_as_income",
"type": "numeric", "type": "numeric",
"min": 0, "min": 0,
"step": 1, "step": 1,

7
spec/requests/form_controller_spec.rb

@ -66,6 +66,13 @@ RSpec.describe FormController, type: :request do
expect(response).to have_http_status(:not_found) expect(response).to have_http_status(:not_found)
end end
end end
context "a form page that has custom guidance" do
it "displays the correct partial" do
get "/logs/#{case_log.id}/net-income", headers: headers, params: {}
expect(response.body).to match("What counts as income?")
end
end
end end
context "check answers pages" do context "check answers pages" do

Loading…
Cancel
Save