aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-04-17 09:25:54 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-04-17 09:25:54 +0000
commite5b3d08a0a10169cc7d482d13d5b5429162206c4 (patch)
treeabda9dacb0b222324f2313a87a23b4917c29c3ab /actionpack/test
parentc3ca5ab7a80702b63dc77748043f8a72ff1529a5 (diff)
downloadrails-e5b3d08a0a10169cc7d482d13d5b5429162206c4.tar.gz
rails-e5b3d08a0a10169cc7d482d13d5b5429162206c4.tar.bz2
rails-e5b3d08a0a10169cc7d482d13d5b5429162206c4.zip
Added that render_partial called from a controller will use the action name as default #828 [Dan Peterson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1182 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/render_test.rb9
-rw-r--r--actionpack/test/fixtures/test/_partial_only.rhtml1
2 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index e471139d8f..fd3e08177a 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -59,6 +59,10 @@ class TestController < ActionController::Base
render_action "list"
end
+ def partial_only
+ render_partial
+ end
+
def hello_in_a_string
@customers = [ Customer.new("david"), Customer.new("mary") ]
render_text "How's there? #{render_to_string("test/list")}"
@@ -181,6 +185,11 @@ class RenderTest < Test::Unit::TestCase
assert_equal "Hello: davidHello: mary", process_request.body
end
+ def test_partial_only
+ @request.action = "partial_only"
+ assert_equal "only partial", process_request.body
+ end
+
def test_render_to_string
@request.action = "hello_in_a_string"
assert_equal "How's there? Hello: davidHello: mary", process_request.body
diff --git a/actionpack/test/fixtures/test/_partial_only.rhtml b/actionpack/test/fixtures/test/_partial_only.rhtml
new file mode 100644
index 0000000000..a44b3eed40
--- /dev/null
+++ b/actionpack/test/fixtures/test/_partial_only.rhtml
@@ -0,0 +1 @@
+only partial \ No newline at end of file