Sha256: a6414aebadaf36e714215bf6175d88a1612b447edd2a98344ca5657588968ebb

Contents?: true

Size: 782 Bytes

Versions: 2

Compression:

Stored size: 782 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(I18n.t("pinfirmable.resend_email.notice_html",
                                          email: "test@example.com",
                                          not_correct_link: "<a rel=\"nofollow\" data-method=\"delete\" href=\"/users/sign_out\">Not the right email?</a>"))
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pinfirmable-0.1.5 spec/controllers/pinfirmable_controller/resend_email_spec.rb
pinfirmable-0.1.4 spec/controllers/pinfirmable_controller/resend_email_spec.rb