Browse Source

Don't introduce heisenspecs

pull/192/head
baarkerlounger 3 years ago
parent
commit
751e8b5f1c
  1. 6
      spec/views/form/page_view_spec.rb

6
spec/views/form/page_view_spec.rb

@ -11,6 +11,7 @@ RSpec.describe "form/page" do
let(:subsection) { form.get_subsection("income_and_benefits") }
let(:page) { form.get_page("net_income") }
let(:question) { page.questions.find { |q| q.id == "earnings" } }
let(:initial_attribs) { { type: "numeric", answer_options: nil } }
def assign_attributes(object, attrs)
attrs.each_pair do |attr, value|
@ -20,6 +21,7 @@ RSpec.describe "form/page" do
context "given a question with extra guidance" do
let(:expected_guidance) { /What counts as income?/ }
before do
assign(:case_log, case_log)
assign(:page, page)
@ -28,6 +30,10 @@ RSpec.describe "form/page" do
render
end
after do
assign_attributes(question, initial_attribs)
end
context "with radio type" do
let(:attribs) { { type: "radio", answer_options: { "1": "A", "2": "B" } } }
it "renders the guidance partial for radio questions" do

Loading…
Cancel
Save