aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/mailers
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:03:39 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 19:03:39 +0200
commitb91ff557ef6f621d1b921f358fd5b8a5d9e9090e (patch)
tree7ddf032dc48adccb182fffd2f0364f363ab8d497 /actionmailer/test/mailers
parentc3e7abddfb759eecb30cd59f27103fda4c4827dc (diff)
downloadrails-b91ff557ef6f621d1b921f358fd5b8a5d9e9090e.tar.gz
rails-b91ff557ef6f621d1b921f358fd5b8a5d9e9090e.tar.bz2
rails-b91ff557ef6f621d1b921f358fd5b8a5d9e9090e.zip
applies new string literal convention in actionmailer/test
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'actionmailer/test/mailers')
-rw-r--r--actionmailer/test/mailers/base_mailer.rb28
-rw-r--r--actionmailer/test/mailers/delayed_mailer.rb6
-rw-r--r--actionmailer/test/mailers/proc_mailer.rb6
3 files changed, 20 insertions, 20 deletions
diff --git a/actionmailer/test/mailers/base_mailer.rb b/actionmailer/test/mailers/base_mailer.rb
index 8c2225ce60..fd7397be84 100644
--- a/actionmailer/test/mailers/base_mailer.rb
+++ b/actionmailer/test/mailers/base_mailer.rb
@@ -1,12 +1,12 @@
class BaseMailer < ActionMailer::Base
self.mailer_name = "base_mailer"
- default to: 'system@test.lindsaar.net',
- from: 'jose@test.plataformatec.com',
- reply_to: 'mikel@test.lindsaar.net'
+ default to: "system@test.lindsaar.net",
+ from: "jose@test.plataformatec.com",
+ reply_to: "mikel@test.lindsaar.net"
def welcome(hash = {})
- headers['X-SPAM'] = "Not SPAM"
+ headers["X-SPAM"] = "Not SPAM"
mail({subject: "The first email on new API!"}.merge!(hash))
end
@@ -28,30 +28,30 @@ class BaseMailer < ActionMailer::Base
end
def inline_attachment
- attachments.inline['logo.png'] = "\312\213\254\232"
+ attachments.inline["logo.png"] = "\312\213\254\232"
mail
end
def attachment_with_content(hash = {})
- attachments['invoice.pdf'] = 'This is test File content'
+ attachments["invoice.pdf"] = "This is test File content"
mail(hash)
end
def attachment_with_hash
- attachments['invoice.jpg'] = { data: ::Base64.encode64("\312\213\254\232)b"),
+ attachments["invoice.jpg"] = { data: ::Base64.encode64("\312\213\254\232)b"),
mime_type: "image/x-jpg",
transfer_encoding: "base64" }
mail
end
def attachment_with_hash_default_encoding
- attachments['invoice.jpg'] = { data: "\312\213\254\232)b",
+ attachments["invoice.jpg"] = { data: "\312\213\254\232)b",
mime_type: "image/x-jpg" }
mail
end
def implicit_multipart(hash = {})
- attachments['invoice.pdf'] = 'This is test File content' if hash.delete(:attachments)
+ attachments["invoice.pdf"] = "This is test File content" if hash.delete(:attachments)
mail(hash)
end
@@ -60,7 +60,7 @@ class BaseMailer < ActionMailer::Base
end
def explicit_multipart(hash = {})
- attachments['invoice.pdf'] = 'This is test File content' if hash.delete(:attachments)
+ attachments["invoice.pdf"] = "This is test File content" if hash.delete(:attachments)
mail(hash) do |format|
format.text { render text: "TEXT Explicit Multipart" }
format.html { render text: "HTML Explicit Multipart" }
@@ -100,18 +100,18 @@ class BaseMailer < ActionMailer::Base
end
end
- def implicit_different_template(template_name='')
+ def implicit_different_template(template_name="")
mail(template_name: template_name)
end
- def explicit_different_template(template_name='')
+ def explicit_different_template(template_name="")
mail do |format|
format.text { render template: "#{mailer_name}/#{template_name}" }
format.html { render template: "#{mailer_name}/#{template_name}" }
end
end
- def different_layout(layout_name='')
+ def different_layout(layout_name="")
mail do |format|
format.text { render layout: layout_name }
format.html { render layout: layout_name }
@@ -131,6 +131,6 @@ class BaseMailer < ActionMailer::Base
end
def with_subject_interpolations
- mail(subject: default_i18n_subject(rapper_or_impersonator: 'Slim Shady'), body: '')
+ mail(subject: default_i18n_subject(rapper_or_impersonator: "Slim Shady"), body: "")
end
end
diff --git a/actionmailer/test/mailers/delayed_mailer.rb b/actionmailer/test/mailers/delayed_mailer.rb
index e6211ef028..cae4ec2f48 100644
--- a/actionmailer/test/mailers/delayed_mailer.rb
+++ b/actionmailer/test/mailers/delayed_mailer.rb
@@ -1,4 +1,4 @@
-require 'active_job/arguments'
+require "active_job/arguments"
class DelayedMailerError < StandardError; end
@@ -17,10 +17,10 @@ class DelayedMailer < ActionMailer::Base
end
def test_message(*)
- mail(from: 'test-sender@test.com', to: 'test-receiver@test.com', subject: 'Test Subject', body: 'Test Body')
+ mail(from: "test-sender@test.com", to: "test-receiver@test.com", subject: "Test Subject", body: "Test Body")
end
def test_raise(klass_name)
- raise klass_name.constantize, 'boom'
+ raise klass_name.constantize, "boom"
end
end
diff --git a/actionmailer/test/mailers/proc_mailer.rb b/actionmailer/test/mailers/proc_mailer.rb
index 7e189d861f..f5371fa674 100644
--- a/actionmailer/test/mailers/proc_mailer.rb
+++ b/actionmailer/test/mailers/proc_mailer.rb
@@ -1,8 +1,8 @@
class ProcMailer < ActionMailer::Base
- default to: 'system@test.lindsaar.net',
- 'X-Proc-Method' => Proc.new { Time.now.to_i.to_s },
+ default to: "system@test.lindsaar.net",
+ "X-Proc-Method" => Proc.new { Time.now.to_i.to_s },
subject: Proc.new { give_a_greeting },
- 'x-has-to-proc' => :symbol
+ "x-has-to-proc" => :symbol
def welcome
mail