Browse Source

change the condition to avoid conflicts with 2034 and cover that ticket in this one

pull/1341/head
Arthur Campbell 3 years ago
parent
commit
a152044362
  1. 2
      app/models/form/lettings/pages/tenancy_length.rb
  2. 4
      app/models/lettings_log.rb
  3. 2
      spec/models/form/lettings/pages/tenancy_length_spec.rb

2
app/models/form/lettings/pages/tenancy_length.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::TenancyLength < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "tenancy_length"
@depends_on = [{ "tenancy_type_fixed_term_or_other?" => true }]
@depends_on = [{ "tenancy_type_fixed_term?" => true }]
end
def questions

4
app/models/lettings_log.rb

@ -205,8 +205,8 @@ class LettingsLog < Log
startertenancy == 1
end
def tenancy_type_fixed_term_or_other?
[4, 6, 3].include? tenancy
def tenancy_type_fixed_term?
[4, 6].include? tenancy
end
def is_general_needs?

2
spec/models/form/lettings/pages/tenancy_length_spec.rb

@ -26,6 +26,6 @@ RSpec.describe Form::Lettings::Pages::TenancyLength, type: :model do
end
it "has the correct depends_on" do
expect(page.depends_on).to eq [{ "tenancy_type_fixed_term_or_other?" => true }]
expect(page.depends_on).to eq [{ "tenancy_type_fixed_term?" => true }]
end
end

Loading…
Cancel
Save