Fix tests
This commit is contained in:
parent
6774dd008f
commit
ef1d46d30e
4 changed files with 15 additions and 19 deletions
|
@ -57,7 +57,8 @@ class Backoffice::DossiersListController < ApplicationController
|
||||||
default_sort: dossiers_list_facade.service.default_sort
|
default_sort: dossiers_list_facade.service.default_sort
|
||||||
|
|
||||||
|
|
||||||
@procedure = current_gestionnaire.procedures.find(params[:id])
|
procedure_id = params[:id] || params[:procedure_id]
|
||||||
|
@procedure = current_gestionnaire.procedures.find(procedure_id)
|
||||||
@dossiers_archived = @procedure.dossiers.archived
|
@dossiers_archived = @procedure.dossiers.archived
|
||||||
smart_listing_create :dossiers_archived,
|
smart_listing_create :dossiers_archived,
|
||||||
@dossiers_archived,
|
@dossiers_archived,
|
||||||
|
|
|
@ -51,15 +51,16 @@
|
||||||
= smart_listing_render :all_state_dossiers
|
= smart_listing_render :all_state_dossiers
|
||||||
|
|
||||||
|
|
||||||
.default_data_block
|
- if @dossiers_archived
|
||||||
%div.row.show-block#all_dossiers
|
.default_data_block
|
||||||
%div.header
|
%div.row.show-block#archived_dossiers
|
||||||
%div.col-xs-10.title
|
%div.header
|
||||||
%div.carret-right
|
%div.col-xs-10.title
|
||||||
%div.carret-down
|
%div.carret-right
|
||||||
Dossiers archivés
|
%div.carret-down
|
||||||
%div.col-xs-2.count
|
Dossiers archivés
|
||||||
= pluralize(@dossiers_archived.count, "dossier")
|
%div.col-xs-2.count
|
||||||
|
= pluralize(@dossiers_archived.count, "dossier")
|
||||||
|
|
||||||
%div.body
|
%div.body
|
||||||
= smart_listing_render :dossiers_archived
|
= smart_listing_render :dossiers_archived
|
||||||
|
|
|
@ -104,12 +104,6 @@ describe Backoffice::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context ' when dossier is archived' do
|
|
||||||
let(:dossier_id) { dossier_archived }
|
|
||||||
|
|
||||||
it { expect(subject).to redirect_to('/backoffice') }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when dossier id does not exist' do
|
context 'when dossier id does not exist' do
|
||||||
let(:dossier_id) { bad_dossier_id }
|
let(:dossier_id) { bad_dossier_id }
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do
|
||||||
|
|
||||||
subject { rendered }
|
subject { rendered }
|
||||||
|
|
||||||
it { is_expected.to have_content('Nouveaux dossiers 1 dossiers') }
|
it { is_expected.to have_content('Nouveaux dossiers 1 dossier') }
|
||||||
it { is_expected.to have_content('Dossiers suivis 0 dossiers') }
|
it { is_expected.to have_content('Dossiers suivis 0 dossiers') }
|
||||||
it { is_expected.to have_content('Tous les dossiers 9 dossiers') }
|
it { is_expected.to have_content('Tous les dossiers 9 dossiers') }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue