2015-11-13 15:23:21 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe BackofficeController, type: :controller do
|
|
|
|
describe 'GET #index' do
|
|
|
|
context 'when gestionnaire is not connected'do
|
|
|
|
before do
|
|
|
|
get :index
|
|
|
|
end
|
|
|
|
|
|
|
|
it { expect(response).to redirect_to :new_gestionnaire_session }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when gestionnaire is connected'do
|
|
|
|
before do
|
|
|
|
sign_in create(:gestionnaire)
|
|
|
|
get :index
|
|
|
|
end
|
|
|
|
|
2015-12-02 18:03:52 +01:00
|
|
|
it { expect(response).to redirect_to :backoffice_dossiers }
|
2015-11-13 15:23:21 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|