Fixe les tests
This commit is contained in:
parent
e81f829545
commit
cdceddafe1
2 changed files with 67 additions and 1 deletions
65
spec/helpers/navigation_helper_spec.rb
Normal file
65
spec/helpers/navigation_helper_spec.rb
Normal 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
|
|
@ -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 d’un dossier « à suivre » demandé il y a moins d'une minute")
|
||||
expect(page).to have_text("En préparation")
|
||||
|
||||
|
|
Loading…
Reference in a new issue