2015-08-10 11:05:06 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-08-11 15:22:07 +02:00
|
|
|
describe CommentairesController, type: :controller do
|
2015-08-13 15:55:19 +02:00
|
|
|
let(:dossier) { create(:dossier) }
|
2015-08-20 16:29:06 +02:00
|
|
|
let(:dossier_id) { dossier.id }
|
|
|
|
let(:email_commentaire) { 'test@test.com' }
|
|
|
|
let(:texte_commentaire) { 'Commentaire de test' }
|
2015-08-10 11:05:06 +02:00
|
|
|
|
|
|
|
describe '#POST create' do
|
|
|
|
context 'création correct d\'un commentaire' do
|
|
|
|
it 'depuis la page récapitulatif' do
|
2015-08-20 16:52:36 +02:00
|
|
|
post :create, dossier_id: dossier_id, email_commentaire: email_commentaire, texte_commentaire: texte_commentaire
|
2015-08-10 11:05:06 +02:00
|
|
|
expect(response).to redirect_to("/dossiers/#{dossier_id}/recapitulatif")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|