demarches-normaliennes/spec/controllers/recapitulatif_controller_spec.rb
Tanguy PATTE 3c57643f76 add database cleaner
add factory girl
fix tests
rename dossier_pdf into piece_jointe
rename ref_piece_jointe into content
2015-08-13 15:56:58 +02:00

19 lines
512 B
Ruby

require 'spec_helper'
RSpec.describe RecapitulatifController, type: :controller do
let(:dossier) { create(:dossier) }
let (:bad_dossier_id) { Dossier.count + 10 }
describe "GET #show" do
it "returns http success" do
get :show, dossier_id: dossier.id
expect(response).to have_http_status(:success)
end
it 'redirection vers start si mauvais dossier ID' do
get :show, dossier_id: bad_dossier_id
expect(response).to redirect_to('/start/error_dossier')
end
end
end