aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
Commit message (Collapse)AuthorAgeFilesLines
* ActionMailer::Base can unregister observer(s) and interceptor(s). (#32207)Kota Miyake2018-05-301-14/+81
| | | | | | | | | | | | | | | | | | | | | | | | * ActionMailer::Base can unregister observer(s) and interceptor(s). One or multiple mail observers can be unregistered using `ActionMailer::Base.unregister_observers` or `ActionMailer::Base.unregister_observer`. One or multiple mail interceptors can be unregistered using `ActionMailer::Base.unregister_interceptors` or `ActionMailer::Base.unregister_interceptor`. For preview interceptors, it's possible to use `ActionMailer::Base.unregister_preview_interceptors` or `ActionMailer::Base.unregister_preview_interceptor`. * Ensure to be reset registered observer(s) and interceptor(s) * Add explanation to CHANGELOG * Add original author's name [Kota Miyake + Rafael Mendonça França + Claudio Ortolina]
* Replace `assert !` with `assert_not`Daniel Colson2018-04-191-4/+4
| | | | | This autocorrects the violations after adding a custom cop in 3305c78dcd.
* Perform email jobs in #assert_emailsGannon McGibbon2018-03-121-0/+22
| | | | Perform enqueued delivery jobs in #assert_emails and #assert_no_emails.
* Use assert_empty and assert_not_emptyDaniel Colson2018-01-251-1/+1
|
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-2/+2
|
* Use respond_to test helpersDaniel Colson2018-01-251-2/+2
|
* Merge pull request #30391 from jbourassa/fix-actionmailer-lambda-defaultRyuta Kamizono2018-01-242-1/+17
|\ | | | | | | Fix actionmailer lambda default
| * Fix AM::Base.default proc arity breaking changeJimmy Bourassa2017-08-292-1/+17
| | | | | | | | | | | | | | PR #29270 changed the number of arguments that gets passed to Procs defined in ActionMail::Base.default. With this changeset, Procs can now have 1 or 0 arguments Also adds test coverage for AM::Base.default Proc arity.
* | Enable `Layout/SpaceBeforeComma` rubocop rule, and fixed moreRyuta Kamizono2017-12-122-2/+2
| | | | | | | | Follow up of #31390.
* | Fix tests on Mail 2.7Jeremy Daer2017-10-312-17/+16
| | | | | | | | | | Reverts 4d96be1c27bd6faed957b197a461f18543acebf2 References #31026
* | Merge pull request #31004 from shuheiktgw/remove_unnecessary_returnsRafael França2017-10-311-1/+1
|\ \ | | | | | | Remove redundant return statements
| * | removed unnecessary returnsShuhei Kitagawa2017-10-281-1/+1
| | |
* | | removed unnecessary semicolonsShuhei Kitagawa2017-10-281-6/+6
|/ /
* / Add assert_enqueued_email_with to ActionMailer::TestHelperMikkel Malmberg2017-09-271-0/+42
|/
* Do not generate default alt text in image tagsCameron Cundiff2017-08-173-5/+5
| | | | | | | | | | | | | | | | | | | | | - Auto-generating content from the filename of an image is not suitable alternative text; alt text that isn't fully considered can be distracting and fatiguing for screen readers users (blind, low vision, dyslexic people). - Setting a filename fallback short circuits screen reader default behavior and configuration for blank descriptions. - Setting poor defaults also creates false negatives for accessibility linting and testing software, that makes it harder to improve application accessibility. *** - After this change, if authors leave images without alt text, screen readers will fallback to default behavior for missing alt text. - Also with this change, Automated linting and testing tools will correctly generate warnings. [Fixes #30096]
* Clear mail after testyuuji.yaginuma2017-08-141-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | If clear it before the test, the mail of the last executed test will not be correctly cleared. Therefore, executing the test with seed below will result in an error. ``` ./bin/test -w --seed 55480 Run options: --seed 55480 # Running: ...........................................................................................................................................................F Failure: MailDeliveryTest#test_does_not_increment_the_deliveries_collection_on_error [/home/yaginuma/program/rails/master_y_yagi/rails/actionmailer/test/delivery_methods_test.rb:221]: --- expected +++ actual @@ -1 +1 @@ -[] +[#<Mail::Message:47011389364640, Multipart: false, Headers: <Date: Mon, 14 Aug 2017 07:48:40 +0900>, <From: test-sender@test.com>, <To: test-receiver@test.com>, <Message-ID: <5990d748ea5b2_29342ac1af8bcf40886f7@yaginuma.mail>>, <Subject: Test Subject>, <Mime-Version: 1.0>, <Content-Type: text/plain>, <Content-Transfer-Encoding: 7bit>>] bin/test test/delivery_methods_test.rb:216 ```
* Merge remote-tracking branch 'origin/master' into unlock-minitestRafael Mendonça França2017-08-0121-0/+42
|\
| * Use frozen string literal in actionmailer/Kir Shatrov2017-07-2321-0/+42
| |
* | Merge branch 'master' into unlock-minitestKasper Timm Hansen2017-07-152-2/+15
|\|
| * Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-0221-21/+0
| | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
| * Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-0221-0/+21
| |\ | | | | | | | | | Enforce frozen string in Rubocop
| | * Enforce frozen string in RubocopKir Shatrov2017-07-0121-0/+21
| | |
| * | Make ActionMailer frozen string literal friendly.Pat Allan2017-06-201-2/+2
| |/
| * Allow mailers to configure their delivery jobMatthew Mongeau2017-06-151-0/+13
| | | | | | | | | | | | | | | | | | | | | | Setting delivery_job on a mailer class will cause MessageDelivery to use the specified job instead of ActionMailer::DeliveryJob: class MyMailer < ApplicationMailer self.delivery_job = MyCustomDeliveryJob ... end
* | Merge branch 'master' into unlock-minitestKasper Timm Hansen2017-05-293-12/+8
|\|
| * Define path with __dir__bogdanvlviv2017-05-233-4/+4
| | | | | | | | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
| * Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-7/+3
| |
| * Should escape meta characters in regexpRyuta Kamizono2017-05-071-1/+1
| |
* | Avoid stubing on this testRafael Mendonça França2017-04-271-3/+2
|/ | | | | This will avoid to the test fail when running in isolation because the message generated is nil.
* Merge pull request #28244 from ixti/improve/action-mailer-preview-paramsRafael França2017-04-261-0/+16
|\ | | | | Pass request params to ActionMailer::Preview
| * Pass request params to ActionMailer::PreviewAlexey Zapparov2017-03-011-0/+16
| |
* | Remove duplicated `delivery_method` definitionyuuji.yaginuma2017-04-071-1/+0
| | | | | | | | | | `ActionMailer::Base.delivery_method` is already defined in https://github.com/rails/rails/blob/master/actionmailer/test/parameterized_test.rb#L13
* | Use better duration aliases in testsAndrew White2017-03-151-2/+2
| |
* | Don't cast to float unnecessarilyAndrew White2017-03-151-2/+2
| | | | | | | | Adding durations to `Time` instances is perfectly okay.
* | Deprecate implicit coercion of `ActiveSupport::Duration`Andrew White2017-03-021-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently `ActiveSupport::Duration` implicitly converts to a seconds value when used in a calculation except for the explicit examples of addition and subtraction where the duration is the receiver, e.g: >> 2 * 1.day => 172800 This results in lots of confusion especially when using durations with dates because adding/subtracting a value from a date treats integers as a day and not a second, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 2 * 1.day => Mon, 10 Apr 2490 To fix this we're implementing `coerce` so that we can provide a deprecation warning with the intent of removing the implicit coercion in Rails 5.2, e.g: >> 2 * 1.day DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration to a Numeric is deprecated and will raise a TypeError in Rails 5.2. => 172800 In Rails 5.2 it will raise `TypeError`, e.g: >> 2 * 1.day TypeError: ActiveSupport::Duration can't be coerced into Integer This is the same behavior as with other types in Ruby, e.g: >> 2 * "foo" TypeError: String can't be coerced into Integer >> "foo" * 2 => "foofoo" As part of this deprecation add `*` and `/` methods to `AS::Duration` so that calculations that keep the duration as the receiver work correctly whether the final receiver is a `Date` or `Time`, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 1.day * 2 => Fri, 03 Mar 2017 Fixes #27457.
* Add `:args` to `process.action_mailer` eventyuuji.yaginuma2017-02-041-0/+19
|
* Avoid should in test namesRafael Mendonça França2017-01-301-1/+1
|
* Implement respond_to_missing? in the Parameterized::Mailer classRafael Mendonça França2017-01-301-0/+14
|
* Make assert_enqueued_emails + assert_no_enqueued_emails consider ↵David Heinemeier Hansson2017-01-301-0/+18
| | | | | | parameterized delivery jobs Needed for testing of parameterized mailers
* restore `delivery_method` after testyuuji.yaginuma2017-01-291-4/+1
| | | | | Currently use two variables to restore `delivery_method`, but the order of restoring the values is incorrect and does not restore is correctly.
* Offer the option to use parameterization for shared processing of headers ↵David Heinemeier Hansson2017-01-282-0/+55
| | | | | and ivars (#27825) Offer the option to use parameterization for shared processing of headers and ivars
* Don't pollute Object with rubinius_skip and jruby_skipAkira Matsuda2017-01-171-9/+9
| | | | we call them only in the tests
* Reduce string objects by using \ instead of + or << for concatenating stringsAkira Matsuda2017-01-121-5/+5
| | | | (I personally prefer writing one string in one line no matter how long it is, though)
* Use Encoding::UTF_8 constant for default_{internal,external} in the testsAkira Matsuda2017-01-111-2/+2
|
* Merge pull request #27227 from MQuy/allow-custom-content-type-in-mail-bodyRafael Mendonça França2017-01-061-0/+5
|\ | | | | | | Allow to custom content type when setting mailer body
| * Fix wrong typo in testMQuy2016-12-051-1/+1
| |
| * allow context type when set body mailMQuy2016-11-301-0/+5
| |
* | Remove unneeded Deprecation.silenceRafael Mendonça França2017-01-031-3/+1
| |
* | Privatize unneededly protected methods in Action Mailer testsAkira Matsuda2016-12-243-3/+3
|/
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-294-9/+9
|