We settled on using this style in commit 4cbe81a1, but didn't add the
rule enforcing this style and we didn't apply it to existing code.
26 lines
696 B
Ruby
26 lines
696 B
Ruby
# coding: utf-8
|
|
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
|