fix(Dossier.processed_in_month): ensure proper usage via method sig instead of defensive programming style

This commit is contained in:
Martin 2022-04-02 09:05:27 +02:00 committed by mfo
parent d6d9db9721
commit c07e0fc13e
3 changed files with 3 additions and 10 deletions

View file

@ -120,13 +120,13 @@ group :development do
end
group :development, :test do
gem 'sorbet'
gem 'sorbet-runtime'
gem 'graphql-schema_comparator'
gem 'mina', require: false # Deploy
gem 'pry-byebug' # Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'rspec-rails'
gem 'simple_xlsx_reader'
gem 'sorbet'
gem 'sorbet-runtime'
gem 'spring' # Spring speeds up development by keeping your application running in the background
gem 'spring-commands-rspec'
end

View file

@ -22,7 +22,7 @@ class ProcedureArchiveService
dossiers = if archive.time_span_type == 'everything'
dossiers.state_termine
else
dossiers.processed_in_month(archive.month)
dossiers.processed_in_month(archive.month.to_datetime)
end
attachments = ActiveStorage::DownloadableFile.create_list_from_dossiers(dossiers)

View file

@ -1731,13 +1731,6 @@ describe Dossier do
end
end
context 'given a date' do
let(:archive_date) { Date.new(2022, 3, 1) }
it 'includes a dossier processed_at at last day of month' do
expect(Dossier.processed_in_month(archive_date).count).to eq(1)
end
end
context 'given a datetime' do
let(:archive_date) { DateTime.new(2022, 3, 1, 12, 0) }
it 'includes a dossier processed_at at last day of month' do