Commit Graph

413 Commits

Author SHA1 Message Date
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
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
Dmitry Polushkin
5af7cab02d add actionmailer test coverage for undefined delivery method 2014-02-09 18:41:41 +00: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
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
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
Carlos Antonio da Silva
6802196a6b Disable available locales checks to avoid warnings running the tests 2013-12-17 09:05:41 -02: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
Mr A
3134605391 Ruby's new Hash syntax applied in actionmailer 2013-11-14 13:41:37 +05:30
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
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
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
e868441896 Remove hard require to ActionView from ActionMailer 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
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 70d6e16fbad75b89dd1798ed697e7732b8606fa3, reversing
changes made to ea4db3bc078fb3093ecdddffdf4f2f4ff3e1e8f9.

Seems to be a code merge done by mistake.
2013-08-17 21:46:39 +05:30
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
Akira Matsuda
64202abc3d Don't mutate the Base settings by merge!ing the given value 2013-07-26 04:04:51 +09:00
Alex Tsukernik
49185875a5 don't convert mailer default values to procs
Invoke mailer defaults as procs only if they are procs, do not convert
with to_proc.  That an object is convertible to a proc does not mean it's
meant to be always used as a proc.  Fixes #11533
2013-07-22 14:25:20 -04:00
kennyj
98849c71ac Fix AM testcase break with mail 2.5.4. It seems that AM's testcase was wrong. 2013-05-17 09:44:01 +09:00
Anupam Choudhury
2ff2f839ca Refactored to remove unnecessary setup 2013-03-30 13:16:31 +05:30
Vipul A M
6893c23f48 drop an unused hash; change slang to SPECIAL 2013-03-19 11:00:01 +05:30
Olek Janiszewski
57bfbc249e Allow passing interpolations to #default_i18n_subject, e.g.:
# config/locales/en.yml
    en:
      user_mailer:
        welcome:
          subject: 'Hello, %{username}'

    # app/mailers/user_mailer.rb
    class UserMailer < ActionMailer::Base
      def welcome(user)
        mail(subject: default_i18n_subject(username: user.name))
      end
    end
2013-01-24 15:29:24 +01:00
Rafael Mendonça França
d4c94accf7 Remove unneeded tests
These tests are needed only if we are using MiniTest::Spec
2012-12-31 13:57:24 -03:00
Rafael Mendonça França
5da4d5142a Add active_support/testing/autorun
minitest/autorun load minitest/spec polluting the global namespace with
the DSL that we don't want on Rails
2012-12-31 13:57:24 -03:00
Jeremy Kemper
f9da785d0b Move background jobs to the 'jobs' branch until fully baked. Not shipping with Rails 4.0. 2012-12-21 16:29:47 -08:00
Rafael Mendonça França
287a8d878c Merge pull request #8450 from senny/8448_mailer_return_values
the return value of mailer methods should not be relevant
2012-12-10 06:40:33 -08:00
Yves Senn
ec3429a3d6 The return value from mailer methods is not relevant. 2012-12-10 09:10:47 +01:00
Francesco Rodriguez
4ec7493e3c use _action callbacks in actionmailer 2012-12-08 10:21:20 -05:00
Nate Berkopec
9cf33b55f3 Explicit multipart messages respect :parts_order
As issue #7978, the order in which ActionMailer
sends multipart messages could be unintentionally
overwritten if a block is passed to the mail
method. This changes the mail method such that
:parts_order is always respected, regardless of
whether a block is passed to mail.
2012-11-19 11:27:22 -05:00
Jon Leighton
7e17b0baec Revert "Support Mailer.deliver_foo(*args) as a synonym for Mailer.foo(*args).deliver."
This reverts commit 7e0cf563639bc7508da381b1b8321c7a89be1aa8.

Conflicts:
	actionmailer/CHANGELOG.md

See discussion at
7e0cf56363 (commitcomment-2075489)
2012-10-30 18:43:57 +00:00
Yves Senn
b786f065d3 Do not render views when mail() isn't called. (NullMail refactoring) 2012-10-28 20:45:43 +01:00
Kirill Nikitin
96f290eac0 Update actionmailer with new hash syntax. 2012-10-07 21:54:14 +04:00
Jon Leighton
7e0cf56363 Support Mailer.deliver_foo(*args) as a synonym for Mailer.foo(*args).deliver.
This makes it easy to write e.g. `Mailer.expects(:deliver_foo)` when
testing code that calls the mailer.
2012-09-28 12:13:07 +01:00
Mike Moore
58434e05fe Support mailer tests using spec DSL
Improve how mailer tests to resolve mailers from the test name.
Add tests for mailer tests using the minitest spec DSL.
2012-09-24 14:46:58 -06:00
Mike Moore
0ce383db58 Register mailer tests for minitest's spec DSL 2012-09-24 14:31:05 -06:00
Jeremy Kemper
2a301505ec Use synchronous queue by default. Separate queued message delivery jobs from the queued message wrappers so the queue itself needn't be marshaled (due to queue reference QueuedMessage). 2012-09-16 22:37:47 -07:00
Santiago Pastorino
8577687fcb Move queue classes to ActiveSupport 2012-09-14 14:10:00 -07:00
Rafael Mendonça França
45537f00b4 Allow users to configure the queue for the mailers
This allow the users to do:

    config.action_mailer.queue = MyQueue.new

and

    class UsersMailer < ActionMailer::Base
      self.queue = MyQueue.new
    end
2012-09-12 15:32:22 -03:00
Santiago Pastorino
34b23e7110 Action Mailer async flag is true by default using a Synchronous impl 2012-09-11 15:11:52 -07:00
Aditya Sanghi
8fc8763fde Allow delivery method options to be set per mail instance 2012-09-04 22:34:41 +05:30
kennyj
c34022c2ec Added missing require. When performing rake test:isolated, test/base_test.rb was break. 2012-08-29 23:19:48 +09:00
Francesco Rodriguez
73f0afd1d4 Fix ActionMailer tests that depend on run order 2012-08-23 16:15:31 -05:00
José Valim
485e655082 Revert "Merge pull request #7202 from asanghi/perform_deliveries_in_mail"
Reverting because it feels backward to specify a delivery to not
be performed while the e-mail is being composed. It is simpler (and
makes more sense) to delegate the responsibility to the calling code.
2012-08-07 14:00:54 -03:00