demarches-normaliennes/spec/controllers/root_controller_spec.rb
Xavier J 3e55d7ba3b - Delete routes 'users/dossiers/a_traiter - en_attente - termine' for user
- Add routes 'uses/dossiers/?liste=xxx' to reach at file lists for user
2015-12-02 18:03:52 +01:00

34 lines
No EOL
730 B
Ruby

require 'spec_helper'
describe RootController, type: :controller do
subject { get :index }
context 'when User is connected' do
before do
sign_in create(:user)
end
it { expect(subject).to redirect_to(users_dossiers_path) }
end
context 'when Gestionnaire is connected' do
before do
sign_in create(:gestionnaire)
end
it { expect(subject).to redirect_to(backoffice_dossiers_path) }
end
context 'when Administrateur is connected' do
before do
sign_in create(:administrateur)
end
it { expect(subject).to redirect_to(admin_procedures_path) }
end
context 'when nobody is connected' do
it { expect(subject).to redirect_to(new_user_session_path) }
end
end