expect(question.answer_options(log)).toeq({"uprn_not_listed"=>{"value"=>"The address is not listed, I want to enter the address manually"},"UPRN"=>{"value"=>"full address"},"divider"=>{"value"=>true}})
end
it"has the correct displayed answer options"do
stub_request(:get,/api\.os\.uk/)
.to_return(status:200,body:"",headers:{})
expect(question.displayed_answer_options(log)).toeq({"uprn_not_listed"=>{"value"=>"The address is not listed, I want to enter the address manually"},"UPRN"=>{"value"=>"full address"},"divider"=>{"value"=>true}})
end
it"has the correct inferred check answers value"do
context"when the log has address line 1 input only"do
beforedo
log.address_line1_input="Address line 1"
log.postcode_full_input=nil
log.save!(valudate:false)
end
it"has the correct input_playback"do
expect(question.input_playback(log)).toeq("0 addresses found for <strong>Address line 1</strong>. <a href=\"skip_href\">Search again</a>")
end
end
context"when the log has postcode input only"do
beforedo
log.address_line1_input=nil
log.postcode_full_input="A1 1AA"
log.save!(valudate:false)
end
it"has the correct input_playback"do
expect(question.input_playback(log)).toeq("0 addresses found for <strong>A1 1AA</strong>. <a href=\"skip_href\">Search again</a>")
end
end
context"when the log has address line 1 and postcode inputs"do
beforedo
log.address_line1_input="Address line 1"
log.postcode_full_input="A1 1AA"
log.save!(valudate:false)
end
it"has the correct input_playback"do
expect(question.input_playback(log)).toeq("1 address found for <strong>Address line 1</strong> and <strong>A1 1AA</strong>. <a href=\"skip_href\">Search again</a>")