Files
grecia/spec/mailers/devise_mailer_spec.rb
Javi Martín 9028d82f77 Remove unnecessary enconding magic comment
This comment isn't necessary since Ruby 2.0, where UTF-8 became the
default encoding.

I've found this issue thanks to the EmptyLineAfterMagicComment rubocop
rule.
2019-10-24 17:56:03 +02:00

25 lines
680 B
Ruby

require "rails_helper"
describe DeviseMailer do
describe "#confirmation_instructions" do
it "sends emails in the user's locale" do
user = create(:user, locale: "es")
email = I18n.with_locale :en do
DeviseMailer.confirmation_instructions(user, "ABC")
end
expect(email.subject).to include("confirmación")
end
it "reads the from address at runtime" do
Setting["mailer_from_name"] = "New organization"
Setting["mailer_from_address"] = "new@consul.dev"
email = DeviseMailer.confirmation_instructions(create(:user), "ABC")
expect(email).to deliver_from "'New organization' <new@consul.dev>"
end
end
end