2015-11-27 17:13:06 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'admin/procedures/show.html.haml', type: :view do
|
2015-12-04 16:17:35 +01:00
|
|
|
let(:procedure) { create(:procedure) }
|
2015-11-27 17:13:06 +01:00
|
|
|
|
2015-12-04 16:17:35 +01:00
|
|
|
before do
|
|
|
|
assign(:procedure, procedure.decorate)
|
|
|
|
assign(:facade, AdminProceduresShowFacades.new(procedure))
|
2015-11-27 17:13:06 +01:00
|
|
|
|
2015-12-04 16:17:35 +01:00
|
|
|
render
|
|
|
|
end
|
2015-11-27 17:13:06 +01:00
|
|
|
|
2015-12-04 16:17:35 +01:00
|
|
|
describe 'archive and unarchive button' do
|
|
|
|
context 'when procedure is active' do
|
2015-11-27 17:13:06 +01:00
|
|
|
it { expect(rendered).to have_content('Archiver') }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when procedure is archived' do
|
|
|
|
let(:procedure) { create(:procedure, archived: true) }
|
|
|
|
|
2015-11-30 14:48:37 +01:00
|
|
|
it { expect(rendered).to have_content('Réactiver') }
|
2015-11-27 17:13:06 +01:00
|
|
|
end
|
|
|
|
end
|
2015-12-04 16:17:35 +01:00
|
|
|
|
|
|
|
describe 'procedure link is present' do
|
|
|
|
it { expect(rendered).to have_content(new_users_dossiers_url(procedure_id: procedure.id)) }
|
|
|
|
end
|
2015-11-27 17:13:06 +01:00
|
|
|
end
|