Rspec邮件测试与设计链接

时间:2016-04-26 11:16:59

标签: ruby-on-rails ruby ruby-on-rails-4 rspec devise

我有自定义UserMailer,它设计了link- edit_password_path。现在我需要写测试:

require "rails_helper"

RSpec.describe UserMailer, type: :mailer do

  describe "#invitation" do
    let!(:user) { create(:user) }
    let!(:correspondence) { create(:correspondence) }
    let!(:mail) { UserMailer.invitation(user, user.password) }

    it "renders the headers" do
      expect(mail.subject).to eq(correspondence.invitation_subject)
      expect(mail.to).to eq(user.email)
    end
   end
end

错误:

NoMethodError: undefined method `edit_password_url' for #<UserMailer:0x005604b3309248>

如何在rspec中将网址添加到我的邮件程序测试中?

0 个答案:

没有答案