From 063059d6f0dda8185545878af29c50fd43b16d88 Mon Sep 17 00:00:00 2001 From: Kara Diaby Date: Mon, 16 Jan 2023 16:56:20 +0100 Subject: [PATCH] tests --- .../administrateurs/procedures_controller_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/controllers/administrateurs/procedures_controller_spec.rb b/spec/controllers/administrateurs/procedures_controller_spec.rb index 4e6554970..034ec1704 100644 --- a/spec/controllers/administrateurs/procedures_controller_spec.rb +++ b/spec/controllers/administrateurs/procedures_controller_spec.rb @@ -162,6 +162,15 @@ describe Administrateurs::ProceduresController, type: :controller do end end + context 'with specific tag' do + let!(:tag_procedure) { create(:procedure, :published, tags: ['environnement']) } + + it 'returns procedures with specific tag' do + get :all, params: { tag: 'environnement' } + expect(assigns(:procedures).any? { |p| p.id == tag_procedure.id }).to be_truthy + end + end + context 'with libelle search' do let!(:procedure1) { create(:procedure, :published, libelle: 'Demande de subvention') } let!(:procedure2) { create(:procedure, :published, libelle: "Fonds d'aide public « Prime Entrepreneurs des Quartiers »") }