2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-04-24 15:47:46 +02:00
|
|
|
describe Procedure::OneGroupeManagementComponent, type: :component do
|
2023-03-27 16:01:39 +02:00
|
|
|
include Logic
|
|
|
|
|
|
|
|
describe 'render' do
|
|
|
|
let(:procedure) do
|
|
|
|
create(:procedure, types_de_champ_public: [{ type: :integer_number, libelle: 'Age' }])
|
|
|
|
.tap { _1.groupe_instructeurs.create(label: 'groupe 2') }
|
|
|
|
end
|
|
|
|
|
|
|
|
subject do
|
|
|
|
render_inline(described_class.new(revision: procedure.active_revision,
|
2023-04-24 15:47:46 +02:00
|
|
|
groupe_instructeur: procedure.defaut_groupe_instructeur))
|
2023-03-27 16:01:39 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when there are types de champ that can be routed' do
|
|
|
|
before do
|
|
|
|
procedure.draft_revision.add_type_de_champ({
|
|
|
|
type_champ: :drop_down_list,
|
|
|
|
libelle: 'Votre ville',
|
2024-09-20 10:56:12 +02:00
|
|
|
drop_down_options: ["Paris", "Lyon", "Marseille"]
|
2023-03-27 16:01:39 +02:00
|
|
|
})
|
|
|
|
procedure.publish_revision!
|
|
|
|
procedure.reload
|
|
|
|
subject
|
|
|
|
end
|
2023-06-16 15:11:33 +02:00
|
|
|
it { expect(page).to have_text('règle invalide') }
|
2023-03-27 16:01:39 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|