recherche un administrateur par email dans manager

This commit is contained in:
Christophe Robillard 2020-02-18 17:40:30 +01:00
parent ba3d2f1b9f
commit bb61500f9b
2 changed files with 11 additions and 1 deletions

View file

@ -16,7 +16,7 @@ class AdministrateurDashboard < Administrate::BaseDashboard
registration_state: Field::String.with_options(searchable: false),
current_sign_in_at: Field::DateTime,
features: FeaturesField,
email: Field::Email
email: Field::Email.with_options(searchable: false)
}.freeze
# COLLECTION_ATTRIBUTES

View file

@ -51,4 +51,14 @@ describe Manager::AdministrateursController, type: :controller do
expect(Administrateur.find_by(id: admin.id)).to be_nil
end
end
describe '#index' do
render_views
let(:admin) { create(:administrateur) }
it 'searches admin by email' do
get :index, params: { search: admin.email }
expect(response).to be_success
end
end
end