Files
openfoodnetwork/spec/mailers/test_mailer_spec.rb
Maikel Linke dcb6f4676d Remove all unnecessary spec_helper require statements
The `.rspec` file is doing this for us.
2026-01-21 12:35:34 +11:00

20 lines
560 B
Ruby

# frozen_string_literal: true
RSpec.describe Spree::TestMailer do
let(:user) { create(:user) }
context ":from not set explicitly" do
it "falls back to spree config" do
message = Spree::TestMailer.test_email(user)
expect(message.from).to eq [Spree::Config[:mails_from]]
end
end
it "confirm_email accepts a user id as an alternative to a User object" do
expect(Spree::User).to receive(:find).with(user.id).and_return(user)
expect {
Spree::TestMailer.test_email(user.id).deliver_now
}.not_to raise_error
end
end