mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
22 lines
583 B
Ruby
22 lines
583 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
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_class).to receive(:find).with(user.id).and_return(user)
|
|
expect {
|
|
test_email = Spree::TestMailer.test_email(user.id)
|
|
}.to_not raise_error
|
|
end
|
|
end
|