update services specs to use revisions

This commit is contained in:
Paul Chavard 2020-08-27 19:57:21 +02:00
parent 4c0f9a4d61
commit 0a70291b90
2 changed files with 7 additions and 7 deletions

View file

@ -61,7 +61,7 @@ describe AdministrateurUsageStatisticsService do
end
context 'with a freshly active procedure' do
let(:procedure) { create(:procedure, aasm_state: 'publiee') }
let(:procedure) { create(:procedure, :published) }
it do
is_expected.to include(
@ -82,7 +82,7 @@ describe AdministrateurUsageStatisticsService do
end
context 'with a procedure close' do
let(:procedure) { create(:procedure, aasm_state: 'close') }
let(:procedure) { create(:procedure, :closed) }
let!(:dossiers) do
(1..7).flat_map do
[
@ -163,7 +163,7 @@ describe AdministrateurUsageStatisticsService do
end
context 'with a procedure en prod' do
let(:procedure) { create(:procedure, aasm_state: 'publiee') }
let(:procedure) { create(:procedure, :published) }
let!(:dossiers) do
[
create(:dossier, :en_construction, procedure: procedure),
@ -191,7 +191,7 @@ describe AdministrateurUsageStatisticsService do
end
context 'with a procedure en prod and more than 20 dossiers' do
let(:procedure) { create(:procedure, aasm_state: 'publiee') }
let(:procedure) { create(:procedure, :published) }
let!(:dossiers) do
(1..7).flat_map do
[

View file

@ -18,10 +18,10 @@ describe ProcedureExportService do
before do
# change one tdc place to check if the header is ordered
tdc_first = procedure.types_de_champ.first
tdc_last = procedure.types_de_champ.last
tdc_first = procedure.active_revision.revision_types_de_champ.first
tdc_last = procedure.active_revision.revision_types_de_champ.last
tdc_first.update(order_place: tdc_last.order_place + 1)
tdc_first.update(position: tdc_last.position + 1)
procedure.reload
end