|
|
@ -273,6 +273,14 @@ RSpec.describe CaseLogsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "with year and status filter" do |
|
|
|
context "with year and status filter" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
Timecop.freeze(Time.zone.local(2022, 12, 1)) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
after do |
|
|
|
|
|
|
|
Timecop.unfreeze |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
let!(:case_log_2021) do |
|
|
|
let!(:case_log_2021) do |
|
|
|
FactoryBot.create(:case_log, :in_progress, |
|
|
|
FactoryBot.create(:case_log, :in_progress, |
|
|
|
owning_organisation: organisation, |
|
|
|
owning_organisation: organisation, |
|
|
@ -281,18 +289,16 @@ RSpec.describe CaseLogsController, type: :request do |
|
|
|
created_by: user) |
|
|
|
created_by: user) |
|
|
|
end |
|
|
|
end |
|
|
|
let!(:case_log_2022) do |
|
|
|
let!(:case_log_2022) do |
|
|
|
case_log = FactoryBot.build(:case_log, :completed, |
|
|
|
FactoryBot.create(:case_log, :completed, |
|
|
|
owning_organisation: organisation, |
|
|
|
owning_organisation: organisation, |
|
|
|
mrcdate: Time.zone.local(2022, 2, 1), |
|
|
|
mrcdate: Time.zone.local(2022, 2, 1), |
|
|
|
startdate: Time.zone.local(2022, 12, 1), |
|
|
|
startdate: Time.zone.local(2022, 12, 1), |
|
|
|
tenancy: 6, |
|
|
|
tenancy: 6, |
|
|
|
managing_organisation: organisation, |
|
|
|
managing_organisation: organisation, |
|
|
|
created_by: user) |
|
|
|
created_by: user) |
|
|
|
case_log.save!(validate: false) |
|
|
|
|
|
|
|
case_log |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
let!(:case_log_2022_in_progress) do |
|
|
|
let!(:case_log_2022_in_progress) do |
|
|
|
case_log = FactoryBot.build(:case_log, :in_progress, |
|
|
|
FactoryBot.build(:case_log, :in_progress, |
|
|
|
owning_organisation: organisation, |
|
|
|
owning_organisation: organisation, |
|
|
|
mrcdate: Time.zone.local(2022, 2, 1), |
|
|
|
mrcdate: Time.zone.local(2022, 2, 1), |
|
|
|
startdate: Time.zone.local(2022, 12, 1), |
|
|
|
startdate: Time.zone.local(2022, 12, 1), |
|
|
@ -300,8 +306,6 @@ RSpec.describe CaseLogsController, type: :request do |
|
|
|
managing_organisation: organisation, |
|
|
|
managing_organisation: organisation, |
|
|
|
tenancycode: nil, |
|
|
|
tenancycode: nil, |
|
|
|
created_by: user) |
|
|
|
created_by: user) |
|
|
|
case_log.save!(validate: false) |
|
|
|
|
|
|
|
case_log |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "shows case logs for multiple selected statuses and years" do |
|
|
|
it "shows case logs for multiple selected statuses and years" do |
|
|
|