Search code examples
ruby-on-railsrubyrspecdeviserspec-rails

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?


Solution

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