Some fixes after review

This commit is contained in:
Mathieu Magnin 2017-02-01 15:58:56 +01:00
parent 83945b3366
commit 91bd058106
2 changed files with 5 additions and 6 deletions

View file

@ -14,8 +14,7 @@
%div.body
- unless @facade.commentaires.empty?
%div.commentaires
- @facade.commentaires.object.sort.each do |commentaire|
= render partial: 'dossiers/commentaires/commentaire', locals: {commentaire: commentaire}
= render partial: 'dossiers/commentaires/commentaire', collection: @facade.commentaires.object.sort
.row
.col-lg-12.col-md-12.col-sm-12.col-xs-12
%div.split-hr

View file

@ -14,7 +14,7 @@ describe Users::CommentairesController, type: :controller do
context 'création correct d\'un commentaire' do
subject do
sign_in dossier.user
post :create, params: {dossier_id: dossier_id, texte_commentaire: texte_commentaire}
post :create, params: { dossier_id: dossier_id, texte_commentaire: texte_commentaire }
end
it 'depuis la page récapitulatif' do
@ -34,12 +34,12 @@ describe Users::CommentairesController, type: :controller do
end
end
context 'when document is upload whith a commentaire', vcr: {cassette_name: 'controllers_sers_commentaires_controller_upload_doc'} do
context 'when document is upload whith a commentaire', vcr: { cassette_name: 'controllers_sers_commentaires_controller_upload_doc' } do
let(:document_upload) { Rack::Test::UploadedFile.new("./spec/support/files/piece_justificative_0.pdf", 'application/pdf') }
subject do
sign_in dossier.user
post :create, params: {dossier_id: dossier_id, texte_commentaire: texte_commentaire, piece_justificative: {content: document_upload}}
post :create, params: { dossier_id: dossier_id, texte_commentaire: texte_commentaire, piece_justificative: { content: document_upload } }
end
it 'create a new piece justificative' do
@ -88,7 +88,7 @@ describe Users::CommentairesController, type: :controller do
sign_in dossier.user
dossier.replied!
post :create, params: {dossier_id: dossier_id, texte_commentaire: texte_commentaire}
post :create, params: { dossier_id: dossier_id, texte_commentaire: texte_commentaire }
dossier.reload
end