aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-06-29 01:54:16 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-06-29 01:54:16 +0000
commit1fd9a46d713a4b314621bd7cf171bd048b10741f (patch)
tree86f5aa702b43bacee7a3f982b191dac5f4ec7d3c /actionmailer/test
parent5b866f75a7ba5970a51a91cf643d03cc89f5c4c3 (diff)
downloadrails-1fd9a46d713a4b314621bd7cf171bd048b10741f.tar.gz
rails-1fd9a46d713a4b314621bd7cf171bd048b10741f.tar.bz2
rails-1fd9a46d713a4b314621bd7cf171bd048b10741f.zip
Resolve conflict among mailer actions with the same name. Closes #5520.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4509 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/fixtures/first_mailer/share.rhtml1
-rw-r--r--actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml1
-rw-r--r--actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml1
-rw-r--r--actionmailer/test/fixtures/second_mailer/share.rhtml1
-rw-r--r--actionmailer/test/mail_render_test.rb38
-rwxr-xr-xactionmailer/test/mail_service_test.rb2
6 files changed, 41 insertions, 3 deletions
diff --git a/actionmailer/test/fixtures/first_mailer/share.rhtml b/actionmailer/test/fixtures/first_mailer/share.rhtml
new file mode 100644
index 0000000000..da43638ceb
--- /dev/null
+++ b/actionmailer/test/fixtures/first_mailer/share.rhtml
@@ -0,0 +1 @@
+first mail
diff --git a/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
new file mode 100644
index 0000000000..897a5065cf
--- /dev/null
+++ b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
@@ -0,0 +1 @@
+Have a lovely picture, from me. Enjoy! \ No newline at end of file
diff --git a/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml b/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml
index 897a5065cf..e69de29bb2 100644
--- a/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml
+++ b/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml
@@ -1 +0,0 @@
-Have a lovely picture, from me. Enjoy! \ No newline at end of file
diff --git a/actionmailer/test/fixtures/second_mailer/share.rhtml b/actionmailer/test/fixtures/second_mailer/share.rhtml
new file mode 100644
index 0000000000..9a54010672
--- /dev/null
+++ b/actionmailer/test/fixtures/second_mailer/share.rhtml
@@ -0,0 +1 @@
+second mail
diff --git a/actionmailer/test/mail_render_test.rb b/actionmailer/test/mail_render_test.rb
index d581965284..642e15fe60 100644
--- a/actionmailer/test/mail_render_test.rb
+++ b/actionmailer/test/mail_render_test.rb
@@ -15,7 +15,7 @@ class RenderMailer < ActionMailer::Base
recipients recipient
subject "using helpers"
from "tester@example.com"
- body render(:file => "signed_up", :body => { :recipient => recipient })
+ body render(:file => "#{mailer_name}/signed_up", :body => { :recipient => recipient })
end
def initialize_defaults(method_name)
@@ -24,6 +24,22 @@ class RenderMailer < ActionMailer::Base
end
end
+class FirstMailer < ActionMailer::Base
+ def share(recipient)
+ recipients recipient
+ subject "using helpers"
+ from "tester@example.com"
+ end
+end
+
+class SecondMailer < ActionMailer::Base
+ def share(recipient)
+ recipients recipient
+ subject "using helpers"
+ from "tester@example.com"
+ end
+end
+
RenderMailer.template_root = File.dirname(__FILE__) + "/fixtures"
class RenderHelperTest < Test::Unit::TestCase
@@ -46,3 +62,23 @@ class RenderHelperTest < Test::Unit::TestCase
end
end
+class FirstSecondHelperTest < Test::Unit::TestCase
+ def setup
+ ActionMailer::Base.delivery_method = :test
+ ActionMailer::Base.perform_deliveries = true
+ ActionMailer::Base.deliveries = []
+
+ @recipient = 'test@localhost'
+ end
+
+ def test_ordering
+ mail = FirstMailer.create_share(@recipient)
+ assert_equal "first mail", mail.body.strip
+ mail = SecondMailer.create_share(@recipient)
+ assert_equal "second mail", mail.body.strip
+ mail = FirstMailer.create_share(@recipient)
+ assert_equal "first mail", mail.body.strip
+ mail = SecondMailer.create_share(@recipient)
+ assert_equal "second mail", mail.body.strip
+ end
+end
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index c810cf1090..aa9002a262 100755
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
@@ -32,7 +32,7 @@ class FunkyPathMailer < ActionMailer::Base
:body => "not really a jpeg, we're only testing, after all"
end
- def template_path
+ def template_root
"#{File.dirname(__FILE__)}/fixtures/path.with.dots"
end
end