docbrown/spec/mailers/verification_mailer_spec.rb
Ben Halpern 6c71369df5
[deploy] Add community_name to site config (#9864)
* Add community_name to site config

* Fix a spec

* Remove SiteConfig from constants

* Change subjects to method

* Fix subjects method

* Fix linting
2020-08-19 14:54:40 -04:00

17 lines
606 B
Ruby

require "rails_helper"
RSpec.describe VerificationMailer, type: :mailer do
let(:user) { create(:user) }
describe "#account_ownership_verification_email" do
it "works correctly" do
email = described_class.with(user_id: user.id).account_ownership_verification_email
expect(email.subject).not_to be_nil
expect(email.to).to eq([user.email])
expect(email.from).to eq([SiteConfig.email_addresses[:default]])
from = "#{SiteConfig.community_name} Email Verification <#{SiteConfig.email_addresses[:default]}>"
expect(email["from"].value).to eq(from)
end
end
end