2016-02-05 17:40:58 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'admin/gestionnaires/index.html.haml', type: :view do
|
|
|
|
let(:token) { 'super_token' }
|
|
|
|
let(:admin) { create(:administrateur, api_token: token) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
assign(:gestionnaires, (smart_listing_create :gestionnaires,
|
2017-06-12 13:49:51 +02:00
|
|
|
admin.gestionnaires,
|
|
|
|
partial: "admin/gestionnaires/list",
|
|
|
|
array: true))
|
2016-02-05 17:40:58 +01:00
|
|
|
assign(:gestionnaire, Gestionnaire.new())
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'Aucun gestionnaire' do
|
|
|
|
before do
|
|
|
|
render
|
|
|
|
end
|
2016-02-09 18:00:31 +01:00
|
|
|
it { expect(rendered).to have_content('Aucun accompagnateur') }
|
2016-02-05 17:40:58 +01:00
|
|
|
end
|
|
|
|
|
2016-02-09 18:00:31 +01:00
|
|
|
context 'Ajout d\'un accompagnateur' do
|
2016-02-05 17:40:58 +01:00
|
|
|
before do
|
2016-05-20 15:39:17 +02:00
|
|
|
create(:gestionnaire, administrateurs: [admin])
|
2016-02-05 17:40:58 +01:00
|
|
|
admin.reload
|
|
|
|
assign(:gestionnaires, (smart_listing_create :gestionnaires,
|
2017-06-12 13:49:51 +02:00
|
|
|
admin.gestionnaires,
|
|
|
|
partial: "admin/gestionnaires/list",
|
|
|
|
array: true))
|
2016-02-05 17:40:58 +01:00
|
|
|
render
|
|
|
|
end
|
2017-06-01 17:44:56 +02:00
|
|
|
it { expect(rendered).to match(/gest\d+@gest.com/) }
|
2016-02-05 17:40:58 +01:00
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|