2016-10-05 14:28:10 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Users::Dossiers::AddSiretController, type: :controller do
|
|
|
|
describe '#GET show' do
|
|
|
|
let(:dossier) { create :dossier }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in dossier.user
|
|
|
|
end
|
|
|
|
|
2016-11-15 05:36:32 +01:00
|
|
|
subject { get :show, params:{dossier_id: dossier.id }}
|
2016-10-05 14:28:10 +02:00
|
|
|
|
|
|
|
context 'when dossier is not attached at a procedure with individual siret attribut' do
|
|
|
|
it { is_expected.to redirect_to users_dossiers_path }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when dossier is attached at a procedure with individual siret attribut' do
|
|
|
|
let(:procedure) { create :procedure, individual_with_siret: true }
|
|
|
|
let(:dossier) { create :dossier, procedure: procedure }
|
|
|
|
|
|
|
|
it { expect(subject.status).to eq 200 }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|