2018-01-10 16:46:12 +01:00
|
|
|
describe Manager::ProceduresController, type: :controller do
|
|
|
|
describe '#whitelist' do
|
|
|
|
let(:administration) { create :administration }
|
|
|
|
let!(:procedure) { create(:procedure) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in administration
|
2018-01-23 18:16:44 +01:00
|
|
|
post :whitelist, params: { id: procedure.id }
|
2018-01-10 16:46:12 +01:00
|
|
|
procedure.reload
|
|
|
|
end
|
|
|
|
|
|
|
|
it { expect(procedure.whitelisted_at).not_to be_nil }
|
|
|
|
end
|
2020-02-07 15:35:09 +01:00
|
|
|
|
|
|
|
describe '#show' do
|
|
|
|
render_views
|
|
|
|
|
|
|
|
let(:administration) { create(:administration) }
|
|
|
|
let!(:procedure) { create(:procedure, :with_repetition) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(administration)
|
|
|
|
get :show, params: { id: procedure.id }
|
|
|
|
end
|
|
|
|
|
|
|
|
it { expect(response.body).to include('sub type de champ') }
|
|
|
|
end
|
2020-03-05 12:57:28 +01:00
|
|
|
|
|
|
|
describe '#index' do
|
|
|
|
render_views
|
|
|
|
|
|
|
|
let(:administration) { create(:administration) }
|
|
|
|
let!(:dossier) { create(:dossier) }
|
|
|
|
|
|
|
|
context 'sort by dossiers' do
|
|
|
|
before do
|
|
|
|
sign_in(administration)
|
|
|
|
get :index, params: { procedure: { direction: 'asc', order: 'dossiers' } }
|
|
|
|
end
|
|
|
|
|
|
|
|
it { expect(response.body).to include('1 dossier') }
|
|
|
|
end
|
|
|
|
end
|
2018-01-10 16:46:12 +01:00
|
|
|
end
|