* Add automated email ownership emails This is task Michael does manually a lot. There are a lot of cases where we need to validate that an individual has access to the email address associated with their DEV account. This automates a singificant portion of that, and hopefully we can use it in a lot of places.
17 lines
619 B
Ruby
17 lines
619 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
|
|
params = { user_id: user.id }
|
|
email = described_class.account_ownership_verification_email(params)
|
|
|
|
expect(email.subject).not_to be_nil
|
|
expect(email.to).to eq([user.email])
|
|
expect(email.from).to eq([SiteConfig.email_addresses[:default]])
|
|
expect(email["from"].value).to eq("#{ApplicationConfig['COMMUNITY_NAME']} Email Verification <#{SiteConfig.email_addresses[:default]}>")
|
|
end
|
|
end
|
|
end
|