diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-10-13 19:52:37 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-10-13 19:52:37 +0200 |
commit | 1abdc8752d7fbc0733da763e751a2671db42961a (patch) | |
tree | a5d14b25fde2500f79326579d82708e9224e20b8 /actionpack/test | |
parent | 691aa20280456c332bfaaf69b58adc86fd86a2b8 (diff) | |
download | rails-1abdc8752d7fbc0733da763e751a2671db42961a.tar.gz rails-1abdc8752d7fbc0733da763e751a2671db42961a.tar.bz2 rails-1abdc8752d7fbc0733da763e751a2671db42961a.zip |
Added inline builder yield to atom_feed_helper tags where appropriate (Sam Ruby) [#8994 status:committed]
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/atom_feed_helper_test.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionpack/test/template/atom_feed_helper_test.rb index 37632f8ed5..9247a42d33 100644 --- a/actionpack/test/template/atom_feed_helper_test.rb +++ b/actionpack/test/template/atom_feed_helper_test.rb @@ -128,6 +128,28 @@ class ScrollsController < ActionController::Base end end EOT + FEEDS["feed_with_xhtml_content"] = <<-'EOT' + atom_feed 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.summary(:type => 'xhtml') do |xhtml| + xhtml.p "before #{scroll.id}" + xhtml.p {xhtml << scroll.body} + xhtml.p "after #{scroll.id}" + end + entry.tag!('app:edited', Time.now) + + 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)), @@ -245,6 +267,14 @@ class AtomFeedTest < Test::Unit::TestCase end end + def test_feed_xhtml + with_restful_routing(:scrolls) do + get :index, :id => "feed_with_xhtml_content" + assert_match %r{xmlns="http://www.w3.org/1999/xhtml"}, @response.body + assert_select "summary div p", :text => "Something Boring" + assert_select "summary div p", :text => "after 2" + end + end private def with_restful_routing(resources) with_routing do |set| |