diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-07-28 12:03:16 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-28 12:03:16 +0100 |
commit | de211914d84737c4314e862b459b9a23a0baa28f (patch) | |
tree | 3f04c940a4c821014332ddc4f119a81a37db3a33 /actionmailer | |
parent | 6246a8e06035973c88a38826ce1ee6b07b03b8dc (diff) | |
parent | 10d9fe4bf3110c1d5de0c6b509fe0cbb9d5eda1d (diff) | |
download | rails-de211914d84737c4314e862b459b9a23a0baa28f.tar.gz rails-de211914d84737c4314e862b459b9a23a0baa28f.tar.bz2 rails-de211914d84737c4314e862b459b9a23a0baa28f.zip |
Merge commit 'mainstream/master'
Conflicts:
actionpack/lib/action_controller/cookies.rb
actionpack/lib/action_controller/streaming.rb
actionpack/lib/action_controller/test_case.rb
actionpack/lib/action_view/base.rb
actionpack/lib/action_view/helpers/date_helper.rb
actionpack/lib/action_view/helpers/debug_helper.rb
actionpack/lib/action_view/helpers/form_options_helper.rb
actionpack/lib/action_view/helpers/javascript_helper.rb
activerecord/lib/active_record/associations.rb
activerecord/lib/active_record/validations.rb
activeresource/README
activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/data_timezone_info.rb
activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone.rb
railties/doc/guides/actionview/helpers.markdown
railties/doc/guides/actionview/partials.markdown
railties/doc/guides/activerecord/basics.markdown
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 6 | ||||
-rw-r--r-- | actionmailer/test/abstract_unit.rb | 18 | ||||
-rwxr-xr-x | actionmailer/test/mail_service_test.rb | 6 |
3 files changed, 19 insertions, 11 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 5a71935009..a43296461b 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -426,7 +426,8 @@ module ActionMailer #:nodoc: end def template_root=(root) - write_inheritable_attribute(:template_root, ActionView::PathSet.new(Array(root))) + root = ActionView::PathSet::Path.new(root) if root.is_a?(String) + write_inheritable_attribute(:template_root, root) end end @@ -529,7 +530,7 @@ module ActionMailer #:nodoc: end def render_message(method_name, body) - render :file => method_name, :body => body, :use_full_path => true + render :file => method_name, :body => body end def render(opts) @@ -537,7 +538,6 @@ module ActionMailer #:nodoc: if opts[:file] && opts[:file] !~ /\// opts[:file] = "#{mailer_name}/#{opts[:file]}" end - opts[:use_full_path] = true initialize_template_class(body).render(opts) end diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb index 11058a770d..107b2e8bbe 100644 --- a/actionmailer/test/abstract_unit.rb +++ b/actionmailer/test/abstract_unit.rb @@ -30,12 +30,20 @@ class Net::SMTP end end -# Wrap tests that use Mocha and skip if unavailable. -def uses_mocha(test_name) - gem 'mocha', ">=0.9.0" +def uses_gem(gem_name, test_name, version = '> 0') + require 'rubygems' + gem gem_name.to_s, version + require gem_name.to_s yield -rescue Gem::LoadError - $stderr.puts "Skipping #{test_name} tests (Mocha >= 0.5 is required). `gem install mocha` and try again." +rescue LoadError + $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again." +end + +# Wrap tests that use Mocha and skip if unavailable. +unless defined? uses_mocha + def uses_mocha(test_name, &block) + uses_gem('mocha', test_name, '>= 0.5.5', &block) + end end def set_delivery_method(delivery_method) diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 7f4a8817ca..e5ecb0e254 100755 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -942,13 +942,13 @@ end # uses_mocha class InheritableTemplateRootTest < Test::Unit::TestCase def test_attr expected = "#{File.dirname(__FILE__)}/fixtures/path.with.dots" - assert_equal [expected], FunkyPathMailer.template_root.map(&:to_s) + assert_equal expected, FunkyPathMailer.template_root sub = Class.new(FunkyPathMailer) sub.template_root = 'test/path' - assert_equal ['test/path'], sub.template_root.map(&:to_s) - assert_equal [expected], FunkyPathMailer.template_root.map(&:to_s) + assert_equal 'test/path', sub.template_root + assert_equal expected, FunkyPathMailer.template_root end end |