Commit Graph

1307 Commits

Author SHA1 Message Date
Akshay Vishnoi 8841f45129 [ci skip] ActionView and ActionMailer CHANGELOG docs fixes 2014-09-18 03:40:51 +05:30
Godfrey Chan 2b41343c34 Default to sorting user's test cases for now
Goals:

1. Default to :random for newly generated applications
2. Default to :sorted for existing applications with a warning
3. Only show the warning once
4. Only show the warning if the app actually uses AS::TestCase

Fixes #16769
2014-09-08 05:32:16 -07:00
Cristian Bica 15ddf60e05 Rename remaining :in / :at to :wait / :wait_until 2014-09-04 08:08:06 +03:00
Cristian Bica 1e237b4e44 Active Job refactoring 2014-09-03 23:01:46 +03:00
Matthew Draper 2f52f96988 Leave all our tests as order_dependent! for now
We're seeing too many failures to believe otherwise.

This reverts commits bc116a55ca,
cbde413df3,
bf0a67931d, and
2440933fe2.
2014-09-02 23:55:34 +09:30
yuuji.yaginuma 83bf95faac [ci skip] Fix a typo in the doc of MessageDelivery 2014-09-02 17:57:23 +09:00
Abdelkader Boudih 377d0de843 [ActionMailer] Rename test/test_test to test/test_case_test 2014-08-30 14:38:33 +00:00
Robin Dupret 84c0f73c8d Refer to the library name instead of the constant
When we are loading a component and we want to know its version, we are
actually not speaking about the constant but the library itself.

[ci skip]

[Godfrey Chan & Xavier Noria]
2014-08-30 11:58:23 +02:00
David Heinemeier Hansson 7475b43cdb Merge branch 'master' of github.com:rails/rails 2014-08-29 14:54:08 -07:00
Robin Dupret a548e2ba16 Make test:isolated run without bundler for Action Mailer
Action Mailer tests weren't able to run in isolation without the bundle
exec prefix since we were requiring gems before requiring abstract_unit.

We don't need the `gem` call thus and the require_relative since the
test directory should be present in the load path when we run any test.
2014-08-29 12:41:37 +02:00
Matthew Draper b47d8dea25 Merge pull request #16598 from seuros/master
[ActionMailer] require activejob railtie
2014-08-23 03:45:47 +09:30
Abdelkader Boudih 39704bb89f [ActionMailer] require activejob railtie 2014-08-22 17:37:36 +00:00
Xavier Noria b6ccaee952 applies API guidelines to new AM docs 2014-08-21 23:27:25 +02:00
Akira Matsuda 31abbe5154 Fix SyntaxError 2014-08-21 06:40:00 +09:00
Rafael Mendonça França f7851c61d8 Make the explicit the Active Job dependency of Action Mailer 2014-08-20 16:51:17 -03:00
Abdelkader Boudih 6e75e7e3bc [Rdoc] Make clear that we are sending an AR object [ci skip] 2014-08-20 16:41:00 +00:00
Abdelkader Boudih d1629346b9 Fix typo in rdoc [ci skip] 2014-08-20 16:22:41 +00:00
Cristian Bica 9e7f4a94ca Updated rdoc / guides / release notes related to ActiveJob / ActionMailer 2014-08-20 17:48:34 +03:00
Cristian Bica f4ee114746 Deprecated .deliver / .deliver! to .deliver_now / .deliver_now! 2014-08-20 17:48:34 +03:00
Akira Matsuda 0df2a83b7f Clear deliveries in order not to affect other tests 2014-08-20 19:07:03 +09:00
Lucas Mazza 63f7b22a4e Remove global helpers from the ActionMailer test suite. 2014-08-19 23:53:19 -03:00
David Heinemeier Hansson 6a23bf0f4c Preparing for 4.2.0.beta1 release 2014-08-19 19:32:51 -07:00
David Heinemeier Hansson 78728af2c9 Extra space 2014-08-19 19:31:18 -07:00
Lucas Mazza 04db4c2868 Add `set_delivery_method` and `restore_delivery_method` to `ActionMailer::TestCase`.
This way these methods are available outside the ActionMailer test suite, but
they are still duplicated inside `test/abstract_unit` for test cases that don't
inherit from the `ActionMailer::TestCase` class.
2014-08-19 23:26:45 -03:00
Rafael Mendonça França fad9e729f1 Fix the rails-dom-testing dependecy 2014-08-19 16:41:38 -03:00
Rafael Mendonça França c78da4d5c4 Merge branch 'master' into loofah
Conflicts:
	actionpack/CHANGELOG.md
2014-08-17 22:38:22 -03:00
David Heinemeier Hansson 6e6ebeb03c Add CHANGELOG entry for #deliver_later 2014-08-17 16:57:57 -07:00
Abdelkader Boudih 2f7b239fca [ActiveJob] Use globalid gem 2014-08-17 23:10:45 +00:00
Abdelkader Boudih 299d1f2626 [ActionMailer] Rename ActionMailer::DelayedDeliveryJob to ActionMailer::DeliveryJob 2014-08-17 23:10:08 +00:00
Abdelkader Boudih 6a2ca149fd [ActiveJob] Fix test syntax 2014-08-17 23:09:42 +00:00
Cristian Bica 0e4e496a57 Fixed indentation 2014-08-16 00:30:20 +03:00
Cristian Bica e034ac33ea Removed method missing from ActionMailer::MessageDelivery 2014-08-15 23:20:55 +03:00
Abdelkader Boudih 18303f6e82 Refactor DeliverLater into MessageDelivery 2014-08-14 11:05:35 +00:00
Abdelkader Boudih b937ea893e Make ActionMailer::Previews methods class methods. 2014-08-14 10:55:12 +00:00
Cristian Bica 06908e60be Merge branch 'master' into activejob 2014-08-13 22:55:32 +03:00
Yves Senn e9ce987a9a use :test delivery method for `base_test.rb`
This solves errors like:

```
BaseTest#test_you_can_register_multiple_observers_to_the_mail_object_that_both_get_informed_on_email_delivery:
Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 25
    /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `initialize'
    /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `open'
    /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `tcp_socket'
    /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:551:in `block in do_start'
    /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
    /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `call'
    /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `timeout'
    /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:550:in `do_start'
    /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:520:in `start'
    /Users/senny/Projects/rails/.bundle/gems/mail-2.6.1/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
    /Users/senny/Projects/rails/.bundle/gems/mail-2.6.1/lib/mail/message.rb:2136:in `do_delivery'
    /Users/senny/Projects/rails/.bundle/gems/mail-2.6.1/lib/mail/message.rb:232:in `block in deliver'
    /Users/senny/Projects/rails/actionmailer/lib/action_mailer/base.rb:528:in `block in deliver_mail'
    /Users/senny/Projects/rails/activesupport/lib/active_support/notifications.rb:164:in `block in instrument'
    /Users/senny/Projects/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /Users/senny/Projects/rails/activesupport/lib/active_support/notifications.rb:164:in `instrument'
    /Users/senny/Projects/rails/actionmailer/lib/action_mailer/base.rb:526:in `deliver_mail'
    /Users/senny/Projects/rails/.bundle/gems/mail-2.6.1/lib/mail/message.rb:232:in `deliver'
    /Users/senny/Projects/rails/actionmailer/test/base_test.rb:598:in `block (2 levels) in <class:BaseTest>'
    /Users/senny/Projects/rails/actionmailer/test/base_test.rb:801:in `mail_side_effects'
    /Users/senny/Projects/rails/actionmailer/test/base_test.rb:593:in `block in <class:BaseTest>'
```
where the `:smtp` delivery method was leaked over to other test cases.
2014-08-13 16:00:19 +02:00
Akira Matsuda 2ef0d3bea6 actionmailer_tests_are_order_dependent! 2014-08-13 22:30:23 +09:00
Akira Matsuda bc116a55ca AM, AP, AV, and AMo tests are already order_independent! 2014-08-13 21:25:10 +09:00
Abdelkader Boudih 67f8b6b2bc Added ActionMailer::DeliverLater 2014-08-13 11:36:32 +00:00
Rafael Mendonça França a2400308ea Merge branch 'master' into loofah
Conflicts:
	actionpack/CHANGELOG.md
	actionpack/test/controller/integration_test.rb
	actionview/CHANGELOG.md
2014-08-12 11:10:42 -03:00
Rafael Mendonça França e81f3c210e Nobody sucks so nobody should call this awful method name 2014-08-12 10:51:41 -03:00
Akira Matsuda 6ffb29d24e users_dont_suck_but_only_we_suck_and_only_our_tests_are_order_dependent!
Calling ActiveSupport::TestCase.i_suck_and_my_tests_are_order_dependent! in AS::TestCase makes
everyone's tests order dependent, which should never be done by the framework.
2014-08-12 19:37:04 +09:00
@schneems and @sgrif 2bbcca004c Deprecate `*_path` methods in mailers
Email does not support relative links since there is no implicit host. Therefore all links inside of emails must be fully qualified URLs. All path helpers are now deprecated. When removed, the error will give early indication to developers to use `*_url` methods instead.

Currently if a developer uses a `*_path` helper, their tests and `mail_view` will not catch the mistake. The only way to see the error is by sending emails in production. Preventing sending out emails with non-working path's is the desired end goal of this PR.

Currently path helpers are mixed-in to controllers (the ActionMailer::Base acts as a controller). All `*_url` and `*_path` helpers are made available through the same module. This PR separates this behavior into two modules so we can extend the `*_path` methods to add a Deprecation to them. Once deprecated we can use this same area to raise a NoMethodError and add an informative message directing the developer to use `*_url` instead.

The module with warnings is only mixed in when a controller returns false from the newly added `supports_relative_path?`.

Paired @sgrif & @schneems
2014-07-30 12:01:45 -05:00
Yves Senn b8120ab14d Raise an exception when attachments are added after `mail` was called.
Closes #16163

Adding attachments after a call to `mail` will result in invalid emails.
This is related to the fact, that `mail` is making the required preparations
before the email is ready to be sent. These change depending on your
added attachments.
2014-07-29 09:24:06 +02:00
Rafael Mendonça França 08754f12e6 Merge branch 'rm-remove-mocha'
Conflicts:
	actionpack/test/abstract_unit.rb
2014-07-19 18:17:13 -03:00
Rafael Mendonça França fd6aaaa0c3 Stop requiring mocha automatically
We are planning to remove mocha from our test suite because of
performance problems. To make this possible we should stop require mocha
on ActionSupport::TestCase.

This should not affect applications since users still need to add mocha
to Gemfile and this already load mocha.

Added FIXME notes to place that still need mocha removal
2014-07-19 17:35:12 -03:00
Guo Xiang Tan ee35b79d4c Prefer to pass block when logging.
The Logger by default includes a guard which checks for the
logging level. By removing the custom logging guards, we can decouple
the logging guard from the logging action to be done.

This also follows the good practice listed on http://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance.
2014-07-18 15:04:43 +08:00
Rafael Mendonça França a8c667e8f1 Defining the right dependencies 2014-07-15 13:40:22 -03:00
Rafael Mendonça França 126a15e0fe Include the selector assertions on the test case
We don't need to require users to include this module on
ActionMailer::TestCase
2014-07-15 13:40:18 -03:00
Rafael Mendonça França 75fe384c81 Rails is a module not a class 2014-07-15 13:02:22 -03:00
Santosh Wadghule dfee0327b5 Fix typos like `a html` to `an html` and 'an mail' to 'an email'. [ci skip] 2014-07-14 00:14:47 +05:30
Rafael Mendonça França 3229eda00c Merge pull request #11218 from kaspth/loofah-integration
Loofah-integration

Conflicts:
	actionpack/CHANGELOG.md
	actionview/CHANGELOG.md
2014-07-10 16:52:00 -03:00
Aaron Patterson e0c6b35dac test i18n against a routed app 2014-07-07 15:08:12 -07:00
Dmitry Polushkin 99f8d4feeb add test coverage for the action mailer 2014-07-04 15:55:33 +01:00
Rafael Mendonça França 72f58b0244 Rename preview_enabled option to show_previews 2014-07-01 13:09:24 -03:00
Leonard Garvey 84ed7b8dfe Add configuration to enable mail previews
Adds `config.action_mailer.preview_enabled`

This allows mail previewing to be enabled easily in non-development
environments such as staging. The default is set to true for development
so no changes should be required to existing Rails applications.

The mail preview path can still be configured using the existing
`config.action_mailer.preview_path` configuration option.

Adding this avoids devs from having to do stuff like:
https://gist.github.com/lengarvey/fa2c9bd6cdbeba96526a

Update actionmailer/CHANGELOG with new configuration.
Update configuring guide with new configuratation.
Add `config.action_mailer.preview_path` to configuring guide.
2014-07-01 14:39:59 +10:00
Rafael Mendonça França 6a682e3f8b Merge pull request #15815 from DNNX/mail-helper-refactoring
Remove unused block parameter from #gsub call in AM::MailHelper#block_format
2014-06-19 13:27:03 -03:00
Viktar Basharymau 9f6a796234 Add `logger.debug?` guard to `ActionMailer::LogSubscriber#process`
*TLDR*: The method is 4 times faster when log level is higher than DEBUG.
Also, the other two methods, `#deliver` and `#receive` have similar guard statements,
so this commit adds some symmetry to the code.

This is probably not the most critical part of ActionMailer in terms
of performance, but here are some benchmarks:

```
require 'benchmark/ips'
require 'action_mailer'

event = ActiveSupport::Notifications::Event.new(
            'process.action_mailer',
            Time.now,
            Time.now,
            'bf4e2b36ce085fd35b24',
            { mailer: "UserMailer", action: :welcome }
        )

ActionMailer::Base.logger = ActiveSupport::Logger.new '/dev/null'

subscriber = ActionMailer::LogSubscriber.new
def subscriber.process_with_guard(event)
  return unless logger.debug?
  mailer = event.payload[:mailer]
  action = event.payload[:action]
  debug("\n#{mailer}##{action}: processed outbound mail in #{event.duration.round(1)}ms")
end

Benchmark.ips do |r|
  ActionMailer::Base.logger.level = ::Logger::Severity::INFO
  r.report('no guard') { subscriber.process(event) }
  r.report('   guard') { subscriber.process_with_guard(event) }
end

__END__
Calculating -------------------------------------
            no guard      9640 i/100ms
               guard     38381 i/100ms
-------------------------------------------------
            no guard   169166.9 (±10.2%) i/s -     838680 in   5.007262s
               guard   728184.9 (±9.6%) i/s -    3607814 in   4.999218s
```

When log level is DEBUG, the _guarded_ method is a bit slower. This is a
good tradeoff for 4x improvement in production mode.

```
Benchmark.ips do |r|
  ActionMailer::Base.logger.level = ::Logger::Severity::DEBUG
  r.report('no guard') { subscriber.process(event) }
  r.report('   guard') { subscriber.process_with_guard(event) }
end

__END__
Calculating -------------------------------------
            no guard      4970 i/100ms
               guard      4564 i/100ms
-------------------------------------------------
            no guard    55617.4 (±3.5%) i/s -     278320 in   5.010523s
               guard    49452.1 (±5.6%) i/s -     251020 in   5.093358s

```
2014-06-19 18:52:11 +03:00
Viktar Basharymau e60c85b4b6 Remove unused block parameter from #gsub call in AM::MailHelper#block_format 2014-06-19 17:40:37 +03:00
Timm ff1b7e7535 Restore delivery method on teardowns. 2014-06-16 21:04:26 +02:00
Timm 9c9875b059 Inline Assertion reference. 2014-06-16 21:04:26 +02:00
Timm b276108330 Remove response faking. 2014-06-16 21:04:26 +02:00
Timm 1a8ca9fc35 Use 1.9 syntax. 2014-06-16 21:04:25 +02:00
Timm 94ca27b190 Added rails-dom-testing and rails-html-sanitizer to Gemfile. Added tests for assert_select_email. 2014-06-16 21:04:17 +02:00
Yves Senn f59ed560ac allow preview interceptors to be registered through `config.action_mailer`.
This was partially broken because `preview_interceptors=` just assigned the
raw values, whithout going through `register_preview_interceptor`. Now the
Action Mailer railtie takes care of the `preview_interceptors` option.

This commit is a partial revert of:

Revert "Merge pull request #15739 from y-yagi/correct_doc_for_action_mailer_base"

This reverts commit a15704d7f3, reversing
changes made to 1bd12a8609.

/cc @kuldeepaggarwal @y-yagi
2014-06-15 14:17:00 +02:00
yuuji.yaginuma 71da4b0c79 [ci skip] correct doc for `register_preview_interceptor` 2014-06-15 09:31:28 +09:00
Yves Senn 8f247871bb Merge pull request #15590 from zuhao/refactor_actionview_register_template_handler
Add unregister_template_handler to prevent leaks.

Conflicts:
	actionview/CHANGELOG.md
2014-06-12 14:06:59 +02:00
Zuhao Wan a1dbb4e7e0 Add unregister_template_handler to prevent leaks. 2014-06-12 18:49:40 +08:00
Juanito Fatas 6a781b9245 [ci skip] Improve enable_starttls_auto documentation. 2014-06-11 01:51:06 +08:00
Zuhao Wan 573a8421e7 Restore I18n.locale to default after test.
If i18n_with_controller_test.rb were to run first, the I18n.locale will
be changed to :de, and the following tests in base_test.rb will fail:

"subject gets default from I18n"
“default subject can have interpolations”
"translations are scoped properly"
"implicit multipart with default locale"
2014-06-07 00:52:24 +08:00
Zuhao Wan c4f4123ef4 Restore test deliveries properly in ActionMailer.
`ActionMailer::Base.delivery_method` and
`ActionMailer::Base.perform_deliveries` have leaked states.

"delivery method can be customized per instance" and "delivery method
can be customized in subclasses not changing the parent" in
delivery_methods_test.rb will fail if test_helper_test.rb (in which
TestHelperMailerTest is inherited from ActionMailer::TestCase) runs
before it.
2014-06-07 00:11:24 +08:00
Benjamin Fleischer bb0890d056 Relax mail gem constraint from ~> 2.5.4 to ~> 2.5, >= 2.5.4
This allows Rails users to install mail 2.6 which relaxes
the mime-types dependency, which is a big win for a lot of people.

Previously, the mail gem restricted mime-types to ~> 1.16
but now it has expanded to [">= 1.16", "< 3"]

And the mime-types maintainer will also be checking that
2.x releases don't break mail.

See https://github.com/mikel/mail/pull/713
https://rubygems.org/gems/mail/versions/2.6.0
2014-06-03 11:54:45 -05:00
Zachary Scott 4c66ab2b21 Feature requests should be made on the mailing list, not submitted to
the issue tracker. See also #15455 [ci skip]
2014-06-01 19:11:39 -07:00
Zachary Scott 415ba0c323 Pass through AM documentation re: 02d048d [ci skip] 2014-05-26 16:45:50 -07:00
Zachary Scott 02d048d926 Use "Action Mailer" as canonical name in documentation [ci skip]
See also:
3a297f8db7 (commitcomment-6451708)
2014-05-26 16:38:44 -07:00
Zachary Scott 3a297f8db7 Add description of ActionMailer::TestHelper module [ci skip] 2014-05-26 16:34:16 -07:00
Yves Senn fd6d6dc602 Merge pull request #15083 from zuhao/refactor_actionmailer_i18n_with_controller_test
Use with_translation helper to clean up I18n stored translations.
2014-05-13 10:43:50 +02:00
Zuhao Wan 32ef7d3c5c Use with_translation helper to clean up I18n stored translations. 2014-05-13 16:38:21 +08:00
Yves Senn 9392d1615c Merge pull request #15082 from zuhao/refactor_actionmailer_delivery_methods_test
Clean up deliveries after each test.
2014-05-13 10:32:37 +02:00
Zuhao Wan 5330b894e5 Move state restoration from setup/teardown into affected test cases. 2014-05-13 16:28:39 +08:00
Yves Senn b6d627b49a Merge pull request #15086 from zuhao/refactor_actionmailer_mail_layout_test
Do not clear deliveries in setup.
2014-05-13 09:39:13 +02:00
Zuhao Wan 4d9e4ea47a Remove unnecessary setup and teardown. 2014-05-13 15:03:53 +08:00
Zuhao Wan 275d20ca01 A minor stylistic fix and cleanup of mail deliveries. 2014-05-13 13:01:14 +08:00
Zuhao Wan 1401637e3f Fix state leaks in actionmailer/test/base_test.rb. 2014-05-07 20:49:43 +08:00
Gaurav Sharma c4807672a8 [ci skip] Improve formatting and yml 2014-04-24 18:51:34 +05:30
Arthur Neves f870c4d063
Fix MailerPreview broken tests
`BaseMailerPreview.welcome` is an instance method, so we need to stub the
method on a instance level and not on Class. The stub is important to make
sure the Message object is the same in the other expectations.
This was working randomly because Mocha uses == to compare two objects
on the `with()` expectation and even if the Mail::Message objects were
not the same object they are equal, but thats not the case in 100% of
the runs. So we need to make sure we use `.any_instance` method and have
the right message object.
2014-03-15 18:56:32 -04:00
Arthur Neves d39bba7c85
Make sure we clean preview_interceptors
We should make sure we clean preview_interceptors after each test so they dont leaky to the next test
2014-03-07 14:53:18 -05:00
Vijay Dev 70ff31d69f Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/4_1_release_notes.md
2014-03-07 20:58:11 +05:30
Prem Sichanugrist 2dd2fcf896
Introduce `Rails.gem_version`
This method return `Gem::Version.new(Rails.version)`, suggesting a more
reliable way to perform version comparison.

Example:

    Rails.version #=> "4.1.2"
    Rails.gem_version #=> #<Gem::Version "4.1.2">

    Rails.version > "4.1.10" #=> false
    Rails.gem_version > Gem::Version.new("4.1.10") #=> true
    Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true

This was originally introduced as `.version` by @charliesome in #8501
but got reverted in #10002 since it was not backward compatible.

Also, updating template for `rake update_versions`.
2014-03-05 12:37:38 -05:00
Carlos Antonio da Silva 71b3910a7d Point master changelogs to 4-1-stable branch
Remove 4-1 related entries from master [ci skip]
2014-02-25 09:14:36 -03:00
Yves Senn c554d170e6 update version to 4.2.0.alpha 2014-02-23 13:14:43 +01:00
Zachary Scott f302079d97 ✂️
This commit also addresses rails/docrails#169 and rails/rails#14159
2014-02-23 20:24:23 +11:00
Guillermo Iguaran 1c248dfbab Fix render plain docs example in AM::Base
The errors were introduced in e220a34e39
2014-02-18 15:18:37 -05:00
robertomiranda e220a34e39 Update Docs in favor to use render plain instead of text option
ref #14062
2014-02-18 15:05:10 -05:00
Rafael Mendonça França 1879c259b8 Merge branch '4-1-0-beta2'
Conflicts:
	actionview/CHANGELOG.md
	activerecord/CHANGELOG.md
2014-02-18 16:00:47 -03:00
Rafael Mendonça França 8b20c72dd8 Preparing for 4.1.0.beta2 release 2014-02-18 15:45:20 -03:00
Rafael Mendonça França 99cdad6d9c Fix typo [ci skip] 2014-02-16 21:49:50 -03:00
Rafael Mendonça França e4911e9162 Merge pull request #13997 from dmitry/test_coverage_improvement
Test coverage improvement
2014-02-09 16:51:59 -02:00
Dmitry Polushkin 5af7cab02d add actionmailer test coverage for undefined delivery method 2014-02-09 18:41:41 +00:00
Vijay Dev 92fdd65162 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/active_record_validations.md
	guides/source/api_documentation_guidelines.md
	guides/source/configuring.md
2014-02-09 23:33:55 +05:30
Yves Senn 02f9f33142 tidy CHANGELOGs [ci skip] 2014-01-30 11:12:46 +01:00
Robin Dupret 718d3b0bc5 Remove an extra comment [ci skip] 2014-01-26 13:11:26 +01:00
Andrew White 4df9cc29c1 Support underscored symbols in Action Mailer config
We allow the use of underscored symbols to represent classes throughout
other parts of Rails so it seems incongruous that it's not supported in
`register_interceptor` and `register_observer`.
2014-01-26 12:05:35 +00:00
Andrew White 7d86352f83 Don't use a class_attribute for ActionMailer::Base.preview_path
Since preview_path is read from ActionMailer::Base when previewing, subclasses
can’t change it so don’t there's no need for the extra overhead imposed by using it.
2014-01-26 12:05:35 +00:00
Andrew White 35fd81672e Add the ability to intercept emails before previewing
To support the ability for tools like CSS style inliners to operate on emails
being previewed this commit adds a hook in a similar fashion to the existing
delivery interceptor hook, e.g:

  class CSSInlineStyler
    def self.previewing_email(message)
      # inline CSS styles
    end
  end

  ActionMailer::Base.register_preview_interceptor CSSInlineStyler

Fixes #13622.
2014-01-26 12:05:35 +00:00
Yves Senn 080fc9cad3 docs should say `email` not `Email`. [ci skip] 2014-01-20 15:04:36 +01:00
Waynn Lue 4dbc62dabd e-mail => email, and subject/verb agreement 2014-01-13 11:56:00 -08:00
Kuldeep Aggarwal 1ea0ae6637 removed extra comma [ci skip] 2014-01-14 01:18:00 +05:30
Gaurish Sharma 35e56f6fa5 standardize on jruby_skip & rbx_skip
This Adds helpers(jruby_skip & rbx_skip). In Future, Plan is to use
these helpers instead of calls directly to
RUBY_ENGINE/RbConfig/JRUBY_VERSION
2014-01-13 19:51:47 +05:30
Yves Senn 535bd55fcd quick formatting pass through CHANGELOGS. [ci skip]. 2014-01-06 10:57:00 +01:00
Andrew White 3713e43366 Add preview_path to autoload_paths in after_initialize
Only config.autoload_paths is frozen, so add the preview_path
to ActiveSupport::Dependencies.autoload_paths directly in an
after_initialize block. Also protect against a blank preview_path
being added to autoload_paths which can cause a serious slowdown
as Dir[] tries to load all *_preview.rb files under /

Fixes #13372
2014-01-04 18:42:34 +00:00
Vipul A M 98cb3e69af update copyright notices to 2014. [ci skip] 2014-01-01 23:59:49 +05:30
Chun-wei Kuo fbbd4e1899 Improve font of some code in API documentation [ci skip]
* Add "<tt>" or "+" to improve font of some code and filenames in API documentation
* Does not contain wording changes
2013-12-26 18:54:46 +08:00
Yves Senn 69b5dc7e00 document how to access mail previews. [ci skip]
/cc @pixeltrix
2013-12-18 14:38:02 +01:00
David Heinemeier Hansson c0a2d474c5 Get ready to release 4.1.0.beta1 2013-12-17 16:05:28 -08:00
Carlos Antonio da Silva 6802196a6b Disable available locales checks to avoid warnings running the tests 2013-12-17 09:05:41 -02:00
Andrew White d6dec7fcb6 Add mailer previews feature based on mail_view gem 2013-12-17 03:58:35 +00:00
Łukasz Strzałkowski e064658d64 Include AV::Layouts directly in AM::Base
No need to do this in railtie as AM depends on AV either way
2013-12-05 01:03:03 +01:00
Łukasz Strzałkowski d8888b94b3 Retain ActionPack dependency on ActionView 2013-12-05 01:02:46 +01:00
Yves Senn 23aa94a7b2 `mail()` without arguments is a getter for the current mail.
This behavior is documented in our guides (http://edgeguides.rubyonrails.org/action_mailer_basics.html#action-mailer-callbacks)
but was broken in the past. This commit short curcuits
the `mail` method if:

  1. mail() was previously called
  2. no headers are passed
  3. no block is passed

Closes #13090.

/cc @pixeltrix
2013-12-02 16:56:31 +01:00
Xavier Noria 17c29a0df0 Merge remote-tracking branch 'docrails/master'
Conflicts:
	activesupport/lib/active_support/core_ext/hash/deep_merge.rb
	activesupport/lib/active_support/core_ext/hash/keys.rb
2013-11-24 20:00:24 +01:00
Carlos Antonio da Silva 18964368f3 Improve changelogs
Also make Action Mailer changelog format more consistent with the
others [ci skip]
2013-11-22 08:30:04 -02:00
Mr A 3134605391 Ruby's new Hash syntax applied in actionmailer 2013-11-14 13:41:37 +05:30
Harshad Sabne a1f1e6d9e2 Update README.rdoc [ci skip]
Highlighted code
2013-11-08 13:28:14 +05:30
Aaron Patterson 267e5c84f9 calculate the ivars to remove in advance as a set and cache them in a
constant.

`view_assigns` can use the precalculated sets and remove instance
variables without allocating any extra arrays
2013-11-06 14:21:40 -08:00
Yves Senn 6205476a53 Merge pull request #12591 from vipulnsward/remove_mail_merge
Remove extra variable creation and merge.
2013-10-20 23:58:53 -07:00
Daniel Schierbeck 8f0c5e00ff Instrument the generation of Action Mailer messages
The processing of outbound mail is instrumented with the key
`process.action_mailer`. The payload includes the mailer name as well as
the mailer method.
2013-10-20 15:21:15 +02:00
Vipul A M f72437bf3f Remove extra variable creation and merge. 2013-10-20 10:31:41 +05:30
Waynn Lue ba46d524db take out reference to previous versions of Rails 2013-09-12 14:44:38 -07:00
claudiob d17333d10c Remove unused raw email fixtures
The tests that used the raw_email_* fixtures were removed in d500ad3
2013-09-12 01:09:32 -07:00
Steve Klabnik db2c4abca6 Merge pull request #12184 from waynn/patch-4
"previous version of Rails" is gramatically incorrect
2013-09-10 18:55:29 -07:00
Waynn Lue e2c17ff3ec [ci skip] 'previous version of Rails' is gramatically incorrect 2013-09-10 16:15:41 -07:00
Akira Matsuda 0c93a48904 Don't mutate the Base settings by merge!ing the given value 2013-09-10 18:10:48 +02:00
Łukasz Strzałkowski 40fcb9e822 Revert "Port all remaining self.protected_instance_variables to class methods"
This reverts commit 7de994fa21.
2013-09-02 23:18:02 +02:00
Łukasz Strzałkowski 7de994fa21 Port all remaining self.protected_instance_variables to class methods 2013-08-29 12:13:45 +02:00
Łukasz Strzałkowski 0d43df7ebf Make AV dependency for ActionMailer 2013-08-26 10:54:38 +02:00
Łukasz Strzałkowski e868441896 Remove hard require to ActionView from ActionMailer 2013-08-25 11:39:12 +02:00
Łukasz Strzałkowski 9e6a1439d1 Require log_subscriber 2013-08-25 11:39:12 +02:00
Łukasz Strzałkowski e29c1b3103 Remove dependency on AV 2013-08-25 11:39:12 +02:00
Łukasz Strzałkowski d1760253f5 Load AV::Layout to AM::Base in railties 2013-08-25 11:39:11 +02:00
Łukasz Strzałkowski 2a25c4ce6d Do not silance mail gem warnings.
I doesn't have any at the moment
2013-08-25 11:39:11 +02:00
Łukasz Strzałkowski 3419ac26e9 Include AbsC::Rendering interface in ActionMailer 2013-08-25 11:39:09 +02:00
Łukasz Strzałkowski 75d38e4364 Do not include AV::Rendering
It's already included in Layouts, makes no sense to doubly include it
2013-08-25 11:39:08 +02:00
Łukasz Strzałkowski 8e5a7243a1 Integrate ActionMailer with ActionView 2013-08-25 11:39:08 +02:00
Vijay Dev 9abe72c760 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	actionview/README.rdoc
	activerecord/lib/active_record/migration.rb
	guides/source/development_dependencies_install.md
	guides/source/getting_started.md
2013-08-17 21:49:16 +05:30
Vijay Dev ec8ef1e105 Revert "Merge branch 'master' of github.com:rails/docrails"
This reverts commit 70d6e16fba, reversing
changes made to ea4db3bc07.

Seems to be a code merge done by mistake.
2013-08-17 21:46:39 +05:30
Rafael Mendonça França 4c743fd682 Merge pull request #11722 from arunagw/removed-deprecation-silenced-from-test
As we are doing debug mode on
2013-08-02 12:13:38 -07:00
Arun Agrawal 7e893717aa As we are doing debug mode on
we don't need to silenced it
2013-08-02 14:34:15 -04:00
Rajarshi Das 938481010a map => map! for stopping extra array creation 2013-08-02 18:04:34 +05:30
Arun Agrawal f52832de2a grab executable from rubygems
As done here d7fc97d3f9
2013-07-26 11:07:25 +02:00