Browse Source

Wording in tests and time test

pull/1584/head
Kat 3 years ago
parent
commit
e2350f9988
  1. 8
      spec/components/check_answers_summary_list_card_component_spec.rb
  2. 4
      spec/requests/form_controller_spec.rb

8
spec/components/check_answers_summary_list_card_component_spec.rb

@ -68,6 +68,14 @@ RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do
let(:subsection) { log.form.get_subsection(subsection_id) }
let(:questions) { subsection.applicable_questions(log) }
around do |example|
Timecop.freeze(Time.zone.local(2023, 5, 1))
Singleton.__init__(FormHandler)
example.run
Timecop.return
Singleton.__init__(FormHandler)
end
it "renders a summary list card including question numbers for the answers to those questions" do
expect(rendered).to have_content(questions.first.answer_label(log))
expect(rendered).to have_content("Q32 - Lead tenant’s age")

4
spec/requests/form_controller_spec.rb

@ -569,7 +569,7 @@ RSpec.describe FormController, type: :request do
let(:referrer) { "/lettings-logs/#{lettings_log.id}/#{page_id.dasherize}?referrer=interruption_screen" }
it "routes to the soft validation page" do
expect(response.body).to include("Make sure these answers are all correct")
expect(response.body).to include("Make sure these answers are correct:")
end
end
@ -578,7 +578,7 @@ RSpec.describe FormController, type: :request do
it "skips the soft validation page" do
follow_redirect!
expect(response.body).not_to include("Make sure these answers are all correct")
expect(response.body).not_to include("Make sure these answers are correct:")
end
end
end

Loading…
Cancel
Save