demarches-normaliennes/spec/controllers/manager/gestionnaires_controller_spec.rb

26 lines
579 B
Ruby
Raw Normal View History

2023-08-29 19:08:27 +02:00
describe Manager::GestionnairesController, type: :controller do
let(:super_admin) { create(:super_admin) }
let(:gestionnaire) { create(:gestionnaire) }
before { sign_in super_admin }
describe '#index' do
render_views
it 'searches admin by email' do
get :index, params: { search: gestionnaire.email }
expect(response).to have_http_status(:success)
end
end
describe '#show' do
render_views
before do
get :show, params: { id: gestionnaire.id }
end
it { expect(response.body).to include(gestionnaire.email) }
end
end