简体   繁体   中英

rspec devise-confirmable render 'devise/mailer/confirmation_instructions'

I have a devise confirmable on my user model, and I have tests on custom registrations_controller.

One of tests is like

      it 'renders :new template' do
        post :create, user: valid_params

        expect(response).to render_template(:new)
      end

But there is error:

 Failure/Error: expect(response).to render_template(:new)
   expecting <"new"> but rendering with <["devise/mailer/confirmation_instructions"]>

How to get render of #new template?

It seems I got an error by myself. User just not created, so I got this error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM