Browse Source

delete tests that are no longer needed in 24/25

pull/2492/head
Arthur Campbell 2 years ago
parent
commit
3b0b9a4ca4
  1. 15
      spec/models/form_handler_spec.rb
  2. 38
      spec/requests/form_controller_spec.rb

15
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

38
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

Loading…
Cancel
Save