aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2009-08-09 13:10:14 +1200
committerMichael Koziarski <michael@koziarski.com>2009-08-09 13:10:14 +1200
commitb97d2933747767a1aeacb9594f3d376f5791fc3a (patch)
tree535bf879fbdae93ad623787b741a47db9a1c7799 /actionpack/test
parent271baf235d6e197a6ecd25945c34df0385137764 (diff)
parent370bf1401af62c8589d557cd51b9533dd603c463 (diff)
downloadrails-b97d2933747767a1aeacb9594f3d376f5791fc3a.tar.gz
rails-b97d2933747767a1aeacb9594f3d376f5791fc3a.tar.bz2
rails-b97d2933747767a1aeacb9594f3d376f5791fc3a.zip
Merge branch 'patches'
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/atom_feed_helper_test.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionpack/test/template/atom_feed_helper_test.rb
index 3acaecd142..6a5fb0acff 100644
--- a/actionpack/test/template/atom_feed_helper_test.rb
+++ b/actionpack/test/template/atom_feed_helper_test.rb
@@ -157,6 +157,26 @@ class ScrollsController < ActionController::Base
end
end
EOT
+ FEEDS["provide_builder"] = <<-'EOT'
+ # we pass in the new_xml to the helper so it doesn't
+ # call anything on the original builder
+ new_xml = Builder::XmlMarkup.new(:target=>'')
+ atom_feed(:xml => new_xml) do |feed|
+ feed.title("My great blog!")
+ feed.updated((@scrolls.first.created_at))
+
+ for scroll in @scrolls
+ feed.entry(scroll) do |entry|
+ entry.title(scroll.title)
+ entry.content(scroll.body, :type => 'html')
+
+ entry.author do |author|
+ author.name("DHH")
+ end
+ end
+ end
+ end
+ EOT
def index
@scrolls = [
Scroll.new(1, "1", "Hello One", "Something <i>COOL!</i>", Time.utc(2007, 12, 12, 15), Time.utc(2007, 12, 12, 15)),
@@ -202,6 +222,15 @@ class AtomFeedTest < ActionController::TestCase
end
end
+ def test_providing_builder_to_atom_feed
+ with_restful_routing(:scrolls) do
+ get :index, :id=>"provide_builder"
+ # because we pass in the non-default builder, the content generated by the
+ # helper should go 'nowhere'. Leaving the response body blank.
+ assert @response.body.blank?
+ end
+ end
+
def test_entry_with_prefilled_options_should_use_those_instead_of_querying_the_record
with_restful_routing(:scrolls) do
get :index, :id => "entry_options"