From b95d6e84b00bd926b1118f6a820eca7a870b8c35 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 14 Aug 2010 02:13:00 -0300 Subject: Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) --- actionmailer/test/base_test.rb | 16 ++++++------ actionmailer/test/delivery_methods_test.rb | 6 ++--- actionmailer/test/fixtures/raw_email10 | 2 +- actionmailer/test/fixtures/raw_email2 | 2 +- actionmailer/test/fixtures/raw_email3 | 2 +- actionmailer/test/fixtures/raw_email5 | 2 +- actionmailer/test/fixtures/raw_email6 | 2 +- actionmailer/test/fixtures/raw_email8 | 2 +- actionmailer/test/fixtures/raw_email9 | 10 ++++---- actionmailer/test/fixtures/templates/signed_up.erb | 2 +- .../custom_templating_extension.html.haml | 4 +-- .../custom_templating_extension.text.haml | 4 +-- .../test/fixtures/test_mailer/signed_up.html.erb | 2 +- .../url_test_mailer/signed_up_with_url.erb | 2 +- actionmailer/test/mailers/proc_mailer.rb | 6 ++--- actionmailer/test/old_base/mail_service_test.rb | 30 +++++++++++----------- actionmailer/test/old_base/tmail_compat_test.rb | 2 +- actionmailer/test/old_base/url_test.rb | 2 +- actionmailer/test/test_helper_test.rb | 24 ++++++++--------- 19 files changed, 61 insertions(+), 61 deletions(-) (limited to 'actionmailer/test') diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index fec0ecf477..fb42ccb8aa 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -148,7 +148,7 @@ class BaseTest < ActiveSupport::TestCase assert_equal("application/pdf", email.parts[1].mime_type) assert_equal("VGhpcyBpcyB0ZXN0IEZpbGUgY29udGVudA==\r\n", email.parts[1].body.encoded) end - + test "can embed an inline attachment" do email = BaseMailer.inline_attachment # Need to call #encoded to force the JIT sort on parts @@ -413,7 +413,7 @@ class BaseTest < ActiveSupport::TestCase BaseMailer.welcome.deliver assert_equal(1, BaseMailer.deliveries.length) end - + test "calling deliver, ActionMailer should yield back to mail to let it call :do_delivery on itself" do mail = Mail::Message.new mail.expects(:do_delivery).once @@ -447,7 +447,7 @@ class BaseTest < ActiveSupport::TestCase mail = BaseMailer.welcome_from_another_path(['unknown/invalid', 'another.path/base_mailer']).deliver assert_equal("Welcome from another path", mail.body.encoded) end - + test "assets tags should use ActionMailer's asset_host settings" do ActionMailer::Base.config.asset_host = "http://global.com" ActionMailer::Base.config.assets_dir = "global/" @@ -456,7 +456,7 @@ class BaseTest < ActiveSupport::TestCase assert_equal(%{Dummy}, mail.body.to_s.strip) end - + test "assets tags should use a Mailer's asset_host settings when available" do ActionMailer::Base.config.asset_host = "global.com" ActionMailer::Base.config.assets_dir = "global/" @@ -469,12 +469,12 @@ class BaseTest < ActiveSupport::TestCase end # Before and After hooks - + class MyObserver def self.delivered_email(mail) end end - + test "you can register an observer to the mail object that gets informed on email delivery" do ActionMailer::Base.register_observer(MyObserver) mail = BaseMailer.welcome @@ -493,7 +493,7 @@ class BaseTest < ActiveSupport::TestCase MyInterceptor.expects(:delivering_email).with(mail) mail.deliver end - + test "being able to put proc's into the defaults hash and they get evaluated on mail sending" do mail1 = ProcMailer.welcome yesterday = 1.day.ago @@ -501,7 +501,7 @@ class BaseTest < ActiveSupport::TestCase mail2 = ProcMailer.welcome assert(mail1['X-Proc-Method'].to_s.to_i > mail2['X-Proc-Method'].to_s.to_i) end - + test "we can call other defined methods on the class as needed" do mail = ProcMailer.welcome assert_equal("Thanks for signing up this afternoon", mail.subject) diff --git a/actionmailer/test/delivery_methods_test.rb b/actionmailer/test/delivery_methods_test.rb index 22a7d19bc2..08f84dbf3b 100644 --- a/actionmailer/test/delivery_methods_test.rb +++ b/actionmailer/test/delivery_methods_test.rb @@ -128,7 +128,7 @@ class MailDeliveryTest < ActiveSupport::TestCase Mail::Message.any_instance.expects(:deliver!).never DeliveryMailer.welcome.deliver end - + test "does not append the deliveries collection if told not to perform the delivery" do DeliveryMailer.perform_deliveries = false DeliveryMailer.deliveries.clear @@ -160,7 +160,7 @@ class MailDeliveryTest < ActiveSupport::TestCase DeliveryMailer.welcome.deliver end end - + test "does not increment the deliveries collection on bogus deliveries" do DeliveryMailer.delivery_method = BogusDelivery DeliveryMailer.raise_delivery_errors = false @@ -168,5 +168,5 @@ class MailDeliveryTest < ActiveSupport::TestCase DeliveryMailer.welcome.deliver assert_equal(0, DeliveryMailer.deliveries.length) end - + end diff --git a/actionmailer/test/fixtures/raw_email10 b/actionmailer/test/fixtures/raw_email10 index b1fc2b2617..edad5ccff1 100644 --- a/actionmailer/test/fixtures/raw_email10 +++ b/actionmailer/test/fixtures/raw_email10 @@ -15,6 +15,6 @@ Content-Type: text/plain; charset=X-UNKNOWN Test test. Hi. Waving. m ---------------------------------------------------------------- -Sent via Bell Mobility's Text Messaging service. +Sent via Bell Mobility's Text Messaging service. Envoyé par le service de messagerie texte de Bell Mobilité. ---------------------------------------------------------------- diff --git a/actionmailer/test/fixtures/raw_email2 b/actionmailer/test/fixtures/raw_email2 index 3999fcc877..9f87bb2a98 100644 --- a/actionmailer/test/fixtures/raw_email2 +++ b/actionmailer/test/fixtures/raw_email2 @@ -32,7 +32,7 @@ To: xxxxx xxxx Subject: Fwd: Signed email causes file attachments In-Reply-To: Mime-Version: 1.0 -Content-Type: multipart/mixed; +Content-Type: multipart/mixed; boundary="----=_Part_5028_7368284.1115579351471" References: diff --git a/actionmailer/test/fixtures/raw_email3 b/actionmailer/test/fixtures/raw_email3 index 771a96350d..3a0927490a 100644 --- a/actionmailer/test/fixtures/raw_email3 +++ b/actionmailer/test/fixtures/raw_email3 @@ -31,7 +31,7 @@ Reply-To: Test Tester To: xxxx@xxxx.com, xxxx@xxxx.com Subject: Another PDF Mime-Version: 1.0 -Content-Type: multipart/mixed; +Content-Type: multipart/mixed; boundary="----=_Part_2192_32400445.1115745999735" X-Virus-Scanned: amavisd-new at textdrive.com diff --git a/actionmailer/test/fixtures/raw_email5 b/actionmailer/test/fixtures/raw_email5 index 151c631471..bbe31bcdc5 100644 --- a/actionmailer/test/fixtures/raw_email5 +++ b/actionmailer/test/fixtures/raw_email5 @@ -14,6 +14,6 @@ Importance: normal Test test. Hi. Waving. m ---------------------------------------------------------------- -Sent via Bell Mobility's Text Messaging service. +Sent via Bell Mobility's Text Messaging service. Envoyé par le service de messagerie texte de Bell Mobilité. ---------------------------------------------------------------- diff --git a/actionmailer/test/fixtures/raw_email6 b/actionmailer/test/fixtures/raw_email6 index 93289c4f92..8e37bd7392 100644 --- a/actionmailer/test/fixtures/raw_email6 +++ b/actionmailer/test/fixtures/raw_email6 @@ -15,6 +15,6 @@ Content-Type: text/plain; charset=us-ascii Test test. Hi. Waving. m ---------------------------------------------------------------- -Sent via Bell Mobility's Text Messaging service. +Sent via Bell Mobility's Text Messaging service. Envoyé par le service de messagerie texte de Bell Mobilité. ---------------------------------------------------------------- diff --git a/actionmailer/test/fixtures/raw_email8 b/actionmailer/test/fixtures/raw_email8 index 2382dfdf34..79996365b3 100644 --- a/actionmailer/test/fixtures/raw_email8 +++ b/actionmailer/test/fixtures/raw_email8 @@ -8,7 +8,7 @@ To: xxxxx xxxx Subject: Fwd: Signed email causes file attachments In-Reply-To: Mime-Version: 1.0 -Content-Type: multipart/mixed; +Content-Type: multipart/mixed; boundary="----=_Part_5028_7368284.1115579351471" References: diff --git a/actionmailer/test/fixtures/raw_email9 b/actionmailer/test/fixtures/raw_email9 index 8b9b1eaa04..02ea0b05c5 100644 --- a/actionmailer/test/fixtures/raw_email9 +++ b/actionmailer/test/fixtures/raw_email9 @@ -10,19 +10,19 @@ Date: Wed, 23 Feb 2005 18:20:17 -0400 From: "xxx xxx" Message-ID: <4D6AA7EB.6490534@xxx.xxx> To: xxx@xxx.com -Subject: Stop adware/spyware once and for all. +Subject: Stop adware/spyware once and for all. X-Scanned-By: MIMEDefang 2.11 (www dot roaringpenguin dot com slash mimedefang) -You are infected with: +You are infected with: Ad Ware and Spy Ware -Get your free scan and removal download now, -before it gets any worse. +Get your free scan and removal download now, +before it gets any worse. http://xxx.xxx.info?aid=3D13&?stat=3D4327kdzt -no more? (you will still be infected) +no more? (you will still be infected) http://xxx.xxx.info/discon/?xxx@xxx.com diff --git a/actionmailer/test/fixtures/templates/signed_up.erb b/actionmailer/test/fixtures/templates/signed_up.erb index a85d5fa442..7afe1f651c 100644 --- a/actionmailer/test/fixtures/templates/signed_up.erb +++ b/actionmailer/test/fixtures/templates/signed_up.erb @@ -1,3 +1,3 @@ -Hello there, +Hello there, Mr. <%= @recipient %> \ No newline at end of file diff --git a/actionmailer/test/fixtures/test_mailer/custom_templating_extension.html.haml b/actionmailer/test/fixtures/test_mailer/custom_templating_extension.html.haml index 847d065c37..8dcf9746cc 100644 --- a/actionmailer/test/fixtures/test_mailer/custom_templating_extension.html.haml +++ b/actionmailer/test/fixtures/test_mailer/custom_templating_extension.html.haml @@ -1,6 +1,6 @@ -%p Hello there, +%p Hello there, -%p +%p Mr. = @recipient from haml \ No newline at end of file diff --git a/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.haml b/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.haml index 847d065c37..8dcf9746cc 100644 --- a/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.haml +++ b/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.haml @@ -1,6 +1,6 @@ -%p Hello there, +%p Hello there, -%p +%p Mr. = @recipient from haml \ No newline at end of file diff --git a/actionmailer/test/fixtures/test_mailer/signed_up.html.erb b/actionmailer/test/fixtures/test_mailer/signed_up.html.erb index a85d5fa442..7afe1f651c 100644 --- a/actionmailer/test/fixtures/test_mailer/signed_up.html.erb +++ b/actionmailer/test/fixtures/test_mailer/signed_up.html.erb @@ -1,3 +1,3 @@ -Hello there, +Hello there, Mr. <%= @recipient %> \ No newline at end of file diff --git a/actionmailer/test/fixtures/url_test_mailer/signed_up_with_url.erb b/actionmailer/test/fixtures/url_test_mailer/signed_up_with_url.erb index 4c5806d30d..6e7875cff5 100644 --- a/actionmailer/test/fixtures/url_test_mailer/signed_up_with_url.erb +++ b/actionmailer/test/fixtures/url_test_mailer/signed_up_with_url.erb @@ -1,4 +1,4 @@ -Hello there, +Hello there, Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> <%= welcome_url %> diff --git a/actionmailer/test/mailers/proc_mailer.rb b/actionmailer/test/mailers/proc_mailer.rb index 6a79cd71fc..43916e1421 100644 --- a/actionmailer/test/mailers/proc_mailer.rb +++ b/actionmailer/test/mailers/proc_mailer.rb @@ -6,11 +6,11 @@ class ProcMailer < ActionMailer::Base def welcome mail end - + private - + def give_a_greeting "Thanks for signing up this afternoon" end - + end diff --git a/actionmailer/test/old_base/mail_service_test.rb b/actionmailer/test/old_base/mail_service_test.rb index 831adf3e32..4c93eb63e2 100644 --- a/actionmailer/test/old_base/mail_service_test.rb +++ b/actionmailer/test/old_base/mail_service_test.rb @@ -106,7 +106,7 @@ class TestMailer < ActionMailer::Base cc "Foo áëô îü " bcc "Foo áëô îü " charset "UTF-8" - + body "åœö blah" end @@ -359,7 +359,7 @@ class ActionMailerTest < Test::Unit::TestCase assert_equal "text/plain", created.parts[0].parts[0].mime_type assert_equal "text/html", created.parts[0].parts[1].mime_type assert_equal "application/octet-stream", created.parts[1].mime_type - + end def test_nested_parts_with_body @@ -399,7 +399,7 @@ class ActionMailerTest < Test::Unit::TestCase created = nil assert_nothing_raised { created = TestMailer.signed_up(@recipient) } assert_not_nil created - + expected.message_id = '<123@456>' created.message_id = '<123@456>' @@ -503,7 +503,7 @@ class ActionMailerTest < Test::Unit::TestCase delivered = ActionMailer::Base.deliveries.first expected.message_id = '<123@456>' delivered.message_id = '<123@456>' - + assert_equal expected.encoded, delivered.encoded end @@ -546,10 +546,10 @@ class ActionMailerTest < Test::Unit::TestCase created = TestMailer.different_reply_to @recipient end assert_not_nil created - + expected.message_id = '<123@456>' created.message_id = '<123@456>' - + assert_equal expected.encoded, created.encoded assert_nothing_raised do @@ -558,10 +558,10 @@ class ActionMailerTest < Test::Unit::TestCase delivered = ActionMailer::Base.deliveries.first assert_not_nil delivered - + expected.message_id = '<123@456>' delivered.message_id = '<123@456>' - + assert_equal expected.encoded, delivered.encoded end @@ -581,7 +581,7 @@ class ActionMailerTest < Test::Unit::TestCase created = TestMailer.iso_charset @recipient end assert_not_nil created - + expected.message_id = '<123@456>' created.message_id = '<123@456>' @@ -596,7 +596,7 @@ class ActionMailerTest < Test::Unit::TestCase expected.message_id = '<123@456>' delivered.message_id = '<123@456>' - + assert_equal expected.encoded, delivered.encoded end @@ -631,7 +631,7 @@ class ActionMailerTest < Test::Unit::TestCase expected.message_id = '<123@456>' delivered.message_id = '<123@456>' - + assert_equal expected.encoded, delivered.encoded end @@ -761,10 +761,10 @@ EOF delivered = ActionMailer::Base.deliveries.first assert_not_nil delivered - + expected.message_id = '<123@456>' delivered.message_id = '<123@456>' - + assert_equal expected.encoded, delivered.encoded end @@ -887,7 +887,7 @@ EOF assert_equal "iso-8859-1", mail.parts[1].charset assert_equal "image/jpeg", mail.parts[2].mime_type - + assert_equal "attachment", mail.parts[2][:content_disposition].disposition_type assert_equal "foo.jpg", mail.parts[2][:content_disposition].filename assert_equal "foo.jpg", mail.parts[2][:content_type].filename @@ -1005,7 +1005,7 @@ EOF attachment = mail.attachments.last expected = "01 Quien Te Dij\212at. Pitbull.mp3" - + if expected.respond_to?(:force_encoding) result = attachment.filename.dup expected.force_encoding(Encoding::ASCII_8BIT) diff --git a/actionmailer/test/old_base/tmail_compat_test.rb b/actionmailer/test/old_base/tmail_compat_test.rb index 255205de84..23706e99ff 100644 --- a/actionmailer/test/old_base/tmail_compat_test.rb +++ b/actionmailer/test/old_base/tmail_compat_test.rb @@ -31,5 +31,5 @@ class TmailCompatTest < ActiveSupport::TestCase end assert_equal mail.content_transfer_encoding, "base64" end - + end diff --git a/actionmailer/test/old_base/url_test.rb b/actionmailer/test/old_base/url_test.rb index b6496bfe1b..b4be7dfe32 100644 --- a/actionmailer/test/old_base/url_test.rb +++ b/actionmailer/test/old_base/url_test.rb @@ -83,7 +83,7 @@ class ActionMailerUrlTest < ActionMailer::TestCase assert_nothing_raised { UrlTestMailer.signed_up_with_url(@recipient).deliver } assert_not_nil ActionMailer::Base.deliveries.first delivered = ActionMailer::Base.deliveries.first - + delivered.message_id = '<123@456>' assert_equal expected.encoded, delivered.encoded end diff --git a/actionmailer/test/test_helper_test.rb b/actionmailer/test/test_helper_test.rb index 8ff604c2c7..5a101e852f 100644 --- a/actionmailer/test/test_helper_test.rb +++ b/actionmailer/test/test_helper_test.rb @@ -32,7 +32,7 @@ class TestHelperMailerTest < ActionMailer::TestCase self.class.determine_default_mailer("NotAMailerTest") end end - + def test_charset_is_utf_8 assert_equal "UTF-8", charset end @@ -44,14 +44,14 @@ class TestHelperMailerTest < ActionMailer::TestCase end end end - + def test_repeated_assert_emails_calls assert_nothing_raised do assert_emails 1 do TestHelperMailer.test.deliver end end - + assert_nothing_raised do assert_emails 2 do TestHelperMailer.test.deliver @@ -59,20 +59,20 @@ class TestHelperMailerTest < ActionMailer::TestCase end end end - + def test_assert_emails_with_no_block assert_nothing_raised do TestHelperMailer.test.deliver assert_emails 1 end - + assert_nothing_raised do TestHelperMailer.test.deliver TestHelperMailer.test.deliver assert_emails 3 end end - + def test_assert_no_emails assert_nothing_raised do assert_no_emails do @@ -80,17 +80,17 @@ class TestHelperMailerTest < ActionMailer::TestCase end end end - + def test_assert_emails_too_few_sent error = assert_raise ActiveSupport::TestCase::Assertion do assert_emails 2 do TestHelperMailer.test.deliver end end - + assert_match(/2 .* but 1/, error.message) end - + def test_assert_emails_too_many_sent error = assert_raise ActiveSupport::TestCase::Assertion do assert_emails 1 do @@ -98,17 +98,17 @@ class TestHelperMailerTest < ActionMailer::TestCase TestHelperMailer.test.deliver end end - + assert_match(/1 .* but 2/, error.message) end - + def test_assert_no_emails_failure error = assert_raise ActiveSupport::TestCase::Assertion do assert_no_emails do TestHelperMailer.test.deliver end end - + assert_match(/0 .* but 1/, error.message) end end -- cgit v1.2.3