2015-08-10 11:05:06 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe RecapitulatifController, type: :controller do
|
2015-08-13 15:55:19 +02:00
|
|
|
let(:dossier) { create(:dossier) }
|
|
|
|
|
2015-08-20 16:29:06 +02:00
|
|
|
let(:bad_dossier_id) { Dossier.count + 10 }
|
2015-08-10 11:05:06 +02:00
|
|
|
|
|
|
|
describe "GET #show" do
|
|
|
|
it "returns http success" do
|
2015-08-13 15:55:19 +02:00
|
|
|
get :show, dossier_id: dossier.id
|
2015-08-10 11:05:06 +02:00
|
|
|
expect(response).to have_http_status(:success)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'redirection vers start si mauvais dossier ID' do
|
2015-08-13 15:55:19 +02:00
|
|
|
get :show, dossier_id: bad_dossier_id
|
2015-08-10 11:05:06 +02:00
|
|
|
expect(response).to redirect_to('/start/error_dossier')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|