Sha256: d2bce89cac3523cb11c2b9a3d420628ad335181e9ffe55e3e9b538098e270d76

Contents?: true

Size: 542 Bytes

Versions: 4

Compression:

Stored size: 542 Bytes

Contents

require "spec_helper"

RSpec.describe Devise::PinfirmableController do
  describe "POST resend_email" do
    before do
      @request.env["devise.mapping"] = Devise.mappings[:user]
      @user = User.create(email: "test@example.com", password: "password")
      sign_in @user
    end

    it "redirects back to the confirm page" do
      post :resend_email
      expect(response).to be_redirect
    end

    it "sets the flash" do
      post :resend_email
      expect(flash[:notice]).to eq("We have just resent your code")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pinfirmable-0.1.3 spec/controllers/pinfirmable_controller/resend_email_spec.rb
pinfirmable-0.1.2 spec/controllers/pinfirmable_controller/resend_email_spec.rb
pinfirmable-0.1.1 spec/controllers/pinfirmable_controller/resend_email_spec.rb
pinfirmable-0.1.0 spec/controllers/pinfirmable_controller/resend_email_spec.rb