* Fix email sender and url issues * Add proper tests * Add tests * Change DeviseMailer approach * ZFix devise test
22 lines
659 B
Ruby
22 lines
659 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe DeviseMailer, type: :mailer do
|
|
let(:user) { create(:user) }
|
|
|
|
describe "#reset_password_instructions" do
|
|
let(:email) { described_class.reset_password_instructions(user, "test") }
|
|
|
|
before do
|
|
allow(SiteConfig).to receive(:app_domain).and_return("funky-one-of-a-kind-domain-#{rand(100)}.com")
|
|
end
|
|
|
|
it "renders sender" do
|
|
expected_from = "#{SiteConfig.community_name} Community <#{SiteConfig.email_addresses[:default]}>"
|
|
expect(email["from"].value).to eq(expected_from)
|
|
end
|
|
|
|
it "renders proper URL" do
|
|
expect(email.to_s).to include(SiteConfig.app_domain)
|
|
end
|
|
end
|
|
end
|