aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
Commit message (Collapse)AuthorAgeFilesLines
* Fix the obvious typos detected by github.com/client9/misspellKazuhiro Sera2018-08-081-1/+1
|
* Turn on performance based copsDillon Welch2018-07-231-3/+1
| | | | | | | | | | | | | | | | Use attr_reader/attr_writer instead of methods method is 12% slower Use flat_map over map.flatten(1) flatten is 66% slower Use hash[]= instead of hash.merge! with single arguments merge! is 166% slower See https://github.com/rails/rails/pull/32337 for more conversation
* Fix docs of `assert_no_emails` [ci skip]bogdanvlviv2018-06-291-1/+1
| | | | `assert_no_emails` is shortcut for `assert_emails 0, &block`.
* Allow call `assert_enqueued_with` and `assert_enqueued_email_with` with no blockbogdanvlviv2018-06-292-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Example of `assert_enqueued_with` with no block ```ruby def test_assert_enqueued_with MyJob.perform_later(1,2,3) assert_enqueued_with(job: MyJob, args: [1,2,3], queue: 'low') MyJob.set(wait_until: Date.tomorrow.noon).perform_later assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon) end ``` Example of `assert_enqueued_email_with` with no block: ```ruby def test_email ContactMailer.welcome.deliver_later assert_enqueued_email_with ContactMailer, :welcome end def test_email_with_arguments ContactMailer.welcome("Hello", "Goodbye").deliver_later assert_enqueued_email_with ContactMailer, :welcome, args: ["Hello", "Goodbye"] end ``` Related to #33243
* ActionMailer::Base can unregister observer(s) and interceptor(s). (#32207)Kota Miyake2018-05-304-19/+135
| | | | | | | | | | | | | | | | | | | | | | | | * 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]
* Eager autoload mail gem when eager load is true (#32808)Samuel Cochran2018-05-232-0/+11
| | | | | | | | | | | | | | | | | | | | * Eager autoload mail gem when eager load is true We had a production issue where our Sidekiq worker threads all became deadlocked while autoloading a file within the mail gem, required via ActionMailer, despite setting our Rails applicaiton to eager load. `Mail.eager_autoload!` exists and works great, ActionMailer just doesn't call it during eager loading. Adding it to the ActionMailer Railtie's eager_load_namespaces takes care of calling `Mail.eager_autoload!` during the `eager_load!` initializer. * 'Mail' isn't defined yet, use before_eager_load instead * Make sure mail is loaded * Move eager load of Mail into ActionMailer.eager_load! [Samuel Cochran + Rafael Mendonça França]
* Strip duplicated suffixes more strictlyRyuta Kamizono2018-04-221-1/+1
| | | | In the previous code incorrectly removes intermediate words.
* Replace `assert !` with `assert_not`Daniel Colson2018-04-191-4/+4
| | | | | This autocorrects the violations after adding a custom cop in 3305c78dcd.
* Merge pull request #32427 from tjschuck/small_doc_fixesRyuta Kamizono2018-04-031-1/+1
|\ | | | | | | | | Small doc fixes [ci skip]
| * Small doc fixesT.J. Schuck2018-04-021-1/+1
| | | | | | | | [ci skip]
* | Doc fix added missing quoteMichael H2018-04-021-1/+1
|/
* Partly revert #32231bogdanvlviv2018-03-141-4/+2
| | | | | | | - Remove extra execution of `perform_enqueued_jobs` since it performs all enqueued jobs in the duration of the block. - Fix example of using `assert_emails` without block since we can't use enqueued jobs in this case.
* Merge pull request #32231 from gmcgibbon/perform_email_jobs_in_assert_emailsRafael Mendonça França2018-03-133-6/+32
|\ | | | | | | Perform email jobs in #assert_emails
| * Perform email jobs in #assert_emailsGannon McGibbon2018-03-122-5/+29
|/ | | | Perform enqueued delivery jobs in #assert_emails and #assert_no_emails.
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-172-1/+6
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Remove support to Ruby 2.2Rafael Mendonça França2018-02-161-1/+1
| | | | Rails 6 will only support Ruby >= 2.3.
* Start Rails 6.0 development!!!Rafael Mendonça França2018-01-302-34/+4
| | | | :tada::tada::tada:
* 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-244-2/+34
|\ | | | | | | Fix actionmailer lambda default
| * Fix AM::Base.default proc arity breaking changeJimmy Bourassa2017-08-294-2/+33
| | | | | | | | | | | | | | 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.
* | Fix typos, update documentationJames Lovejoy2018-01-111-1/+1
| | | | | | | | [ci skip]
* | Move the options for deliver_later up near to the example [ci skip]Prathamesh Sonpatki2018-01-041-12/+12
| | | | | | | | | | | | - And move the Active Job related section down. Otherwise it was appearing as if the options are available for the `delivery_job` setting.
* | Bump license years for 2018Yoshiyuki Hirano2017-12-312-2/+2
| |
* | Enable `Layout/SpaceBeforeComma` rubocop rule, and fixed moreRyuta Kamizono2017-12-122-2/+2
| | | | | | | | Follow up of #31390.
* | Preparing for 5.2.0.beta2 releaseRafael Mendonça França2017-11-282-1/+6
| |
* | Fix typos and add a few suggestionsFatos Morina2017-11-281-2/+2
| |
* | Preparing for 5.2.0.beta1 releaseRafael Mendonça França2017-11-272-1/+3
| |
* | Sort mailer previewsDwight Watson2017-11-141-1/+1
| |
* | Use .tt extension to all the template filesRafael Mendonça França2017-11-132-0/+0
| | | | | | | | | | | | | | | | Make clear that the files are not to be run for interpreters. Fixes #23847. Fixes #30690. Closes #23878.
* | 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
|/ /
* | [Action Mailer] require_relative => requireAkira Matsuda2017-10-212-4/+4
| | | | | | | | This basically reverts cd9cc721ab54e2b0c7875cacf2113f03908a8bb7
* | Cleanup CHANGELOGs [ci skip]Ryuta Kamizono2017-10-041-1/+1
| | | | | | | | | | | | | | | | | | * Add missing credit * Add backticks * Fix indentation * Remove trailing spaces And some minor tweaks.
* | Add assert_enqueued_email_with to ActionMailer::TestHelperMikkel Malmberg2017-09-273-0/+92
| |
* | Update Action Mailer doc [ci skip]Yoshiyuki Hirano2017-08-303-8/+8
|/
* Use tt in doc for action_mailer [ci skip]Yoshiyuki Hirano2017-08-261-1/+1
|
* Merge pull request #30213 from ckundo/ccundiff-alt-text-defaultRafael Mendonça França2017-08-233-5/+5
|\ | | | | | | Do not generate default alt text for images
| * 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]
* | Update MIT licenses link [ci skip]Yoshiyuki Hirano2017-08-221-1/+1
|/
* 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 pull request #29559 from kirs/eager-load-controller-actionsRafael França2017-08-111-0/+6
|\ | | | | Eager load controller actions to reduce response time of the first request
| * Eager load controller and mailer actionsKir Shatrov2017-07-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | On the first request, ActionController::Base#action_methods computes and memoized the list of available actions [1]. With this PR we move this expensive operation into eager load step to reduce response time of the first request served in production. This also reduces the memory footprint when running on forking server like Unicorn. [1] https://github.com/rails/rails/blob/a3813dce9a0c950a4af7909111fa730a2622b1db/actionpack/lib/abstract_controller/base.rb#L66-L77
* | Remove outdated comment [ci skip]Youssef Boulkaid2017-08-061-4/+0
| | | | | | | | | | The comment was describing a previous version of the method with a different signature. This is outdated since e76c38e
* | Merge remote-tracking branch 'origin/master' into unlock-minitestRafael Mendonça França2017-08-0142-0/+83
|\|
| * Use frozen string literal in actionmailer/Kir Shatrov2017-07-2342-0/+83
| |
* | Merge branch 'master' into unlock-minitestKasper Timm Hansen2017-07-1510-18/+59
|\|