Fix tests

This commit is contained in:
Mathieu Magnin 2017-02-28 11:37:37 +01:00
parent 6774dd008f
commit ef1d46d30e
4 changed files with 15 additions and 19 deletions

View file

@ -57,7 +57,8 @@ class Backoffice::DossiersListController < ApplicationController
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
smart_listing_create :dossiers_archived,
@dossiers_archived,

View file

@ -51,15 +51,16 @@
= smart_listing_render :all_state_dossiers
.default_data_block
%div.row.show-block#all_dossiers
%div.header
%div.col-xs-10.title
%div.carret-right
%div.carret-down
Dossiers archivés
%div.col-xs-2.count
= pluralize(@dossiers_archived.count, "dossier")
- if @dossiers_archived
.default_data_block
%div.row.show-block#archived_dossiers
%div.header
%div.col-xs-10.title
%div.carret-right
%div.carret-down
Dossiers archivés
%div.col-xs-2.count
= pluralize(@dossiers_archived.count, "dossier")
%div.body
= smart_listing_render :dossiers_archived
%div.body
= smart_listing_render :dossiers_archived

View file

@ -104,12 +104,6 @@ describe Backoffice::DossiersController, type: :controller do
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
let(:dossier_id) { bad_dossier_id }

View file

@ -81,7 +81,7 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do
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('Tous les dossiers 9 dossiers') }