docbrown/spec/mailers/devise_mailer_spec.rb
Anna Buianova 26592a3a9c
Removing Settings::General.email_addresses (#13958)
* Replaced Settings::General.email_addresses with Forem.email

* Removed Settings::General.email_addresses remainders

* Fixed schema.rb

* Remove Settings::General.email_addresses record

* Fixed label for default email
2021-06-11 12:34:34 +03:00

22 lines
655 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(Settings::General).to receive(:app_domain).and_return("funky-one-of-a-kind-domain-#{rand(100)}.com")
end
it "renders sender" do
expected_from = "#{Settings::Community.community_name} <#{ForemInstance.email}>"
expect(email["from"].value).to eq(expected_from)
end
it "renders proper URL" do
expect(email.to_s).to include(Settings::General.app_domain)
end
end
end