|
|
|
|
@ -1,11 +1,13 @@
|
|
|
|
|
require "rails_helper" |
|
|
|
|
|
|
|
|
|
RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do |
|
|
|
|
include CollectionTimeHelper |
|
|
|
|
|
|
|
|
|
subject(:question) { described_class.new(nil, nil, page) } |
|
|
|
|
|
|
|
|
|
let(:page) { instance_double(Form::Page) } |
|
|
|
|
let(:subsection) { instance_double(Form::Subsection) } |
|
|
|
|
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } |
|
|
|
|
let(:form) { instance_double(Form, start_date: current_collection_start_year) } |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
allow(form).to receive(:start_year_2025_or_later?).and_return(false) |
|
|
|
|
@ -29,27 +31,8 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do
|
|
|
|
|
expect(question.derived?(nil)).to be false |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with collection year on or after 2024" do |
|
|
|
|
it "has the correct answer options" do |
|
|
|
|
expect(question.answer_options).to eq({ |
|
|
|
|
"1" => { "value" => "Social rent basis" }, |
|
|
|
|
"2" => { "value" => "Affordable rent basis" }, |
|
|
|
|
"5" => { "value" => "A London Affordable Rent basis" }, |
|
|
|
|
"6" => { "value" => "A Rent to Buy basis" }, |
|
|
|
|
"7" => { "value" => "A London Living Rent basis" }, |
|
|
|
|
"8" => { "value" => "Another Intermediate Rent basis" }, |
|
|
|
|
"divider" => { "value" => true }, |
|
|
|
|
"3" => { "value" => "Don’t know" }, |
|
|
|
|
}) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has the correct question number" do |
|
|
|
|
expect(question.question_number).to eq(17) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with collection year on or after 2025" do |
|
|
|
|
let(:form) { instance_double(Form, start_date: Time.zone.local(2025, 4, 1)) } |
|
|
|
|
let(:form) { instance_double(Form, start_date: collection_start_date_for_year(2025)) } |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
allow(form).to receive(:start_year_2025_or_later?).and_return(true) |
|
|
|
|
|