|
|
|
|
@ -238,17 +238,28 @@ RSpec.describe SalesLogsController, type: :request do
|
|
|
|
|
Timecop.return |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
Timecop.freeze(2022, 4, 1) |
|
|
|
|
sales_log_2022.update!(saledate: Time.zone.local(2022, 4, 1)) |
|
|
|
|
Timecop.freeze(2023, 1, 1) |
|
|
|
|
sales_log_2022.update!(saledate: Time.zone.local(2023, 1, 1)) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
after do |
|
|
|
|
Timecop.unfreeze |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
let!(:sales_log_2022) do |
|
|
|
|
FactoryBot.create(:sales_log, :completed, |
|
|
|
|
owning_organisation: organisation, |
|
|
|
|
saledate: Time.zone.local(2022, 4, 1), |
|
|
|
|
created_by: user) |
|
|
|
|
created_by: user, |
|
|
|
|
saledate: Time.zone.today) |
|
|
|
|
end |
|
|
|
|
let!(:sales_log_2023) do |
|
|
|
|
FactoryBot.create(:sales_log, |
|
|
|
|
owning_organisation: organisation, |
|
|
|
|
saledate: Time.zone.local(2023, 1, 1), |
|
|
|
|
created_by: user) |
|
|
|
|
created_by: user, |
|
|
|
|
saledate: Time.zone.today) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "shows sales logs for multiple selected statuses and years" do |
|
|
|
|
|