Browse Source

Always route to uprn page on sales for 23/24 (#1559)

* Remove routed to on uprn page

* update tests
pull/1414/head
kosiakkatrina 2 years ago committed by GitHub
parent
commit
df8111aab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/models/form/sales/pages/uprn.rb
  2. 19
      spec/models/form/sales/pages/uprn_spec.rb
  3. 1
      spec/models/form/sales/questions/uprn_spec.rb

4
app/models/form/sales/pages/uprn.rb

@ -11,10 +11,6 @@ class Form::Sales::Pages::Uprn < ::Form::Page
] ]
end end
def routed_to?(log, _current_user = nil)
log.uprn_known == 1
end
def skip_text def skip_text
"Enter address instead" "Enter address instead"
end end

19
spec/models/form/sales/pages/uprn_spec.rb

@ -35,25 +35,6 @@ RSpec.describe Form::Sales::Pages::Uprn, type: :model do
expect(page.skip_text).to eq("Enter address instead") expect(page.skip_text).to eq("Enter address instead")
end end
describe "has correct routed_to?" do
context "when uprn_known != 1" do
let(:log) { create(:sales_log, uprn_known: 0) }
it "returns false" do
expect(page.routed_to?(log)).to eq(false)
end
end
context "when uprn_known == 1" do
let(:log) { create(:sales_log) }
it "returns true" do
log.uprn_known = 1
expect(page.routed_to?(log)).to eq(true)
end
end
end
describe "has correct skip_href" do describe "has correct skip_href" do
context "when log is nil" do context "when log is nil" do
it "is nil" do it "is nil" do

1
spec/models/form/sales/questions/uprn_spec.rb

@ -56,6 +56,7 @@ 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",

Loading…
Cancel
Save