test pending demandes
This commit is contained in:
parent
2e041b9d22
commit
967e5e910f
1 changed files with 20 additions and 0 deletions
20
spec/controllers/manager/demandes_controller_spec.rb
Normal file
20
spec/controllers/manager/demandes_controller_spec.rb
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
describe Manager::DemandesController, type: :controller do
|
||||||
|
let(:administration) { create(:administration) }
|
||||||
|
|
||||||
|
describe 'GET #index' do
|
||||||
|
before do
|
||||||
|
sign_in administration
|
||||||
|
end
|
||||||
|
|
||||||
|
it "display pending demandes" do
|
||||||
|
approved_administrateur = create(:administrateur, email: "approved@example.com")
|
||||||
|
pending_demande = { email: 'pending@example.com' }
|
||||||
|
demandes = [{ email: approved_administrateur.email }, pending_demande]
|
||||||
|
allow(PipedriveService).to receive(:get_demandes).and_return(demandes)
|
||||||
|
|
||||||
|
get :index
|
||||||
|
|
||||||
|
expect(assigns(:pending_demandes)).to eq([pending_demande])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue