fix rubocop offenses
This commit is contained in:
parent
aa407d5607
commit
9134114c2e
3 changed files with 8 additions and 10 deletions
|
@ -5,12 +5,11 @@ class ProcedureArchiveService
|
||||||
@procedure = procedure
|
@procedure = procedure
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_pending_archive(instructeur, type, month=nil)
|
def create_pending_archive(instructeur, type, month = nil)
|
||||||
groupe_instructeurs = instructeur
|
groupe_instructeurs = instructeur
|
||||||
.groupe_instructeurs
|
.groupe_instructeurs
|
||||||
.where(procedure: @procedure)
|
.where(procedure: @procedure)
|
||||||
|
|
||||||
|
|
||||||
archive = Archive.for_groupe_instructeur(groupe_instructeurs).find_by(
|
archive = Archive.for_groupe_instructeur(groupe_instructeurs).find_by(
|
||||||
content_type: type,
|
content_type: type,
|
||||||
month: month
|
month: month
|
||||||
|
|
|
@ -36,7 +36,7 @@ describe Instructeurs::ArchivesController, type: :controller do
|
||||||
let(:archive) { create(:archive) }
|
let(:archive) { create(:archive) }
|
||||||
let(:subject) do
|
let(:subject) do
|
||||||
post :create, {
|
post :create, {
|
||||||
params: { procedure_id: procedure1.id, type: 'monthly', month: month }
|
params: { procedure_id: procedure1.id, type: 'monthly', month: month }
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
describe ProcedureArchiveService do
|
describe ProcedureArchiveService do
|
||||||
let(:procedure) { create(:procedure, :published) }
|
let(:procedure) { create(:procedure, :published) }
|
||||||
let(:instructeur) { create(:instructeur) }
|
let(:instructeur) { create(:instructeur) }
|
||||||
let(:service) { ProcedureArchiveService.new(procedure) }
|
let(:service) { ProcedureArchiveService.new(procedure) }
|
||||||
let(:year) { 2020 }
|
let(:year) { 2020 }
|
||||||
let(:month) { 3 }
|
let(:month) { 3 }
|
||||||
let(:date_month) { Date.strptime("#{year}-#{month}", "%Y-%m") }
|
let(:date_month) { Date.strptime("#{year}-#{month}", "%Y-%m") }
|
||||||
describe '#create_pending_archive' do
|
describe '#create_pending_archive' do
|
||||||
|
|
||||||
context 'for a specific month' do
|
context 'for a specific month' do
|
||||||
it 'creates a pending archive' do
|
it 'creates a pending archive' do
|
||||||
archive = service.create_pending_archive(instructeur, 'monthly', date_month)
|
archive = service.create_pending_archive(instructeur, 'monthly', date_month)
|
||||||
|
|
Loading…
Reference in a new issue