|
|
@ -56,18 +56,19 @@ RSpec.describe Form::Sales::Questions::Uprn, type: :model do |
|
|
|
let(:log) do |
|
|
|
let(:log) do |
|
|
|
create( |
|
|
|
create( |
|
|
|
:sales_log, |
|
|
|
:sales_log, |
|
|
|
:completed, |
|
|
|
|
|
|
|
address_line1: "1, Test Street", |
|
|
|
address_line1: "1, Test Street", |
|
|
|
town_or_city: "Test Town", |
|
|
|
town_or_city: "Test Town", |
|
|
|
county: "Test County", |
|
|
|
county: "Test County", |
|
|
|
postcode_full: "AA1 1AA", |
|
|
|
postcode_full: "AA1 1AA", |
|
|
|
la: "E09000003", |
|
|
|
la: "E09000003", |
|
|
|
uprn_known:, |
|
|
|
uprn_known:, |
|
|
|
|
|
|
|
uprn:, |
|
|
|
) |
|
|
|
) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when uprn known nil" do |
|
|
|
context "when uprn known nil" do |
|
|
|
let(:uprn_known) { nil } |
|
|
|
let(:uprn_known) { nil } |
|
|
|
|
|
|
|
let(:uprn) { nil } |
|
|
|
|
|
|
|
|
|
|
|
it "returns formatted value" do |
|
|
|
it "returns formatted value" do |
|
|
|
expect(question.get_extra_check_answer_value(log)).to be_nil |
|
|
|
expect(question.get_extra_check_answer_value(log)).to be_nil |
|
|
@ -76,6 +77,7 @@ RSpec.describe Form::Sales::Questions::Uprn, type: :model do |
|
|
|
|
|
|
|
|
|
|
|
context "when uprn known" do |
|
|
|
context "when uprn known" do |
|
|
|
let(:uprn_known) { 1 } |
|
|
|
let(:uprn_known) { 1 } |
|
|
|
|
|
|
|
let(:uprn) { 123_456_789 } |
|
|
|
|
|
|
|
|
|
|
|
it "returns formatted value" do |
|
|
|
it "returns formatted value" do |
|
|
|
expect(question.get_extra_check_answer_value(log)).to eq( |
|
|
|
expect(question.get_extra_check_answer_value(log)).to eq( |
|
|
@ -86,6 +88,7 @@ RSpec.describe Form::Sales::Questions::Uprn, type: :model do |
|
|
|
|
|
|
|
|
|
|
|
context "when uprn not known" do |
|
|
|
context "when uprn not known" do |
|
|
|
let(:uprn_known) { 0 } |
|
|
|
let(:uprn_known) { 0 } |
|
|
|
|
|
|
|
let(:uprn) { nil } |
|
|
|
|
|
|
|
|
|
|
|
it "returns formatted value" do |
|
|
|
it "returns formatted value" do |
|
|
|
expect(question.get_extra_check_answer_value(log)).to be_nil |
|
|
|
expect(question.get_extra_check_answer_value(log)).to be_nil |
|
|
|