Fixe les tests

This commit is contained in:
Kara Diaby 2024-11-14 08:59:38 +00:00
parent e81f829545
commit cdceddafe1
No known key found for this signature in database
GPG key ID: C4D1B0CF9F24D759
2 changed files with 67 additions and 1 deletions

View file

@ -0,0 +1,65 @@
# frozen_string_literal: true
RSpec.describe NavigationHelper do
describe '#current_nav_section' do
subject { helper.current_nav_section }
context 'when in procedure management section' do
it 'returns procedure_management for administrateurs action' do
allow(helper).to receive(:params).and_return({ action: 'administrateurs' })
expect(subject).to eq('procedure_management')
end
it 'returns procedure_management for stats action' do
allow(helper).to receive(:params).and_return({ action: 'stats' })
expect(subject).to eq('procedure_management')
end
it 'returns procedure_management for email_notifications action' do
allow(helper).to receive(:params).and_return({ action: 'email_notifications' })
expect(subject).to eq('procedure_management')
end
it 'returns procedure_management for deleted_dossiers action' do
allow(helper).to receive(:params).and_return({ action: 'deleted_dossiers' })
expect(subject).to eq('procedure_management')
end
it 'returns procedure_management for groupe_instructeurs controller' do
allow(helper).to receive(:params).and_return({ controller: 'instructeurs/groupe_instructeurs' })
expect(subject).to eq('procedure_management')
end
end
context 'when in user support section' do
it 'returns user_support for email_usagers action' do
allow(helper).to receive(:params).and_return({ action: 'email_usagers' })
expect(subject).to eq('user_support')
end
it 'returns user_support for apercu action' do
allow(helper).to receive(:params).and_return({ action: 'apercu' })
expect(subject).to eq('user_support')
end
end
context 'when in downloads section' do
it 'returns downloads for exports action' do
allow(helper).to receive(:params).and_return({ action: 'exports' })
expect(subject).to eq('downloads')
end
it 'returns downloads for archives controller' do
allow(helper).to receive(:params).and_return({ controller: 'instructeurs/archives' })
expect(subject).to eq('downloads')
end
end
context 'when in no specific section' do
it 'returns follow_up by default' do
allow(helper).to receive(:params).and_return({ action: 'show', controller: 'procedures' })
expect(subject).to eq('follow_up')
end
end
end
end

View file

@ -139,7 +139,8 @@ describe 'Instructing a dossier:', js: true do
expect(page).to have_text('Nous générons cet export.')
click_on "Voir les exports et modèles d'export"
find("button", text: "Téléchargements").click
click_on "Liste des exports"
expect(page).to have_text("Export .csv dun dossier « à suivre » demandé il y a moins d'une minute")
expect(page).to have_text("En préparation")