我有自定义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中将网址添加到我的邮件程序测试中?