From 3b0b9a4ca4711ebabd3343d4d000cd0709854cd9 Mon Sep 17 00:00:00 2001 From: Arthur Campbell Date: Fri, 28 Jun 2024 14:44:40 +0100 Subject: [PATCH] delete tests that are no longer needed in 24/25 --- spec/models/form_handler_spec.rb | 15 ----------- spec/requests/form_controller_spec.rb | 38 --------------------------- 2 files changed, 53 deletions(-) diff --git a/spec/models/form_handler_spec.rb b/spec/models/form_handler_spec.rb index 3747cf92d..05e969500 100644 --- a/spec/models/form_handler_spec.rb +++ b/spec/models/form_handler_spec.rb @@ -245,21 +245,6 @@ RSpec.describe FormHandler do expect(form_handler.lettings_forms["next_lettings"].start_date.year).to eq(2024) end end - - context "when only archived form form is defined in JSON (current collection start year 2024 onwards)" do # TODO: CLDC-3505 remove this test on year hard end - let(:now) { Time.utc(2024, 9, 20) } - - it "creates previous_lettings, current_lettings and next_lettings forms from ruby form objects and archived form from json" do - expect(form_handler.lettings_forms["archived_lettings"]).to be_present - expect(form_handler.lettings_forms["archived_lettings"].start_date.year).to eq(2022) - expect(form_handler.lettings_forms["previous_lettings"]).to be_present - expect(form_handler.lettings_forms["previous_lettings"].start_date.year).to eq(2023) - expect(form_handler.lettings_forms["current_lettings"]).to be_present - expect(form_handler.lettings_forms["current_lettings"].start_date.year).to eq(2024) - expect(form_handler.lettings_forms["next_lettings"]).to be_present - expect(form_handler.lettings_forms["next_lettings"].start_date.year).to eq(2025) - end - end end describe "#ordered_questions_for_year" do diff --git a/spec/requests/form_controller_spec.rb b/spec/requests/form_controller_spec.rb index 575058d6d..35bc774da 100644 --- a/spec/requests/form_controller_spec.rb +++ b/spec/requests/form_controller_spec.rb @@ -1016,44 +1016,6 @@ RSpec.describe FormController, type: :request do end end - context "when the sale date changes from 2024 to 2023" do # TODO: CLDC-3505 remove this test on year hard end - let(:sales_log) { create(:sales_log, owning_organisation: organisation, managing_organisation:, assigned_to: user) } - let(:params) do - { - id: sales_log.id, - sales_log: { - page: "completion_date", - "saledate(3i)" => 30, - "saledate(2i)" => 6, - "saledate(1i)" => 2023, - }, - } - end - let(:managing_organisation) { create(:organisation) } - - before do - organisation.managing_agents << managing_organisation - organisation.reload - sales_log.saledate = Time.zone.local(2024, 12, 1) - sales_log.save!(validate: false) - sales_log.reload - Timecop.freeze(Time.zone.local(2024, 12, 1)) - Singleton.__init__(FormHandler) - end - - after do - Timecop.unfreeze - Singleton.__init__(FormHandler) - end - - it "sets managing organisation to assigned to organisation" do - post "/sales-logs/#{sales_log.id}/completion-date", params: params - sales_log.reload - expect(sales_log.owning_organisation).to eq(organisation) - expect(sales_log.managing_organisation).to eq(organisation) - end - end - context "when the sale date changes from 2024 to a different date in 2024" do let(:sales_log) { create(:sales_log, owning_organisation: organisation, managing_organisation:, assigned_to: user) } let(:params) do