diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2012-04-01 20:07:34 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2012-04-01 20:07:34 +0300 |
commit | e3d1585c8f2eb08e9e8bfa283a54a949f0ec5467 (patch) | |
tree | 3bf9bb6018da3a1c6be9ead44bc4409406fb25cc /actionpack/test/template | |
parent | fa1645a2b73f8bab33b10ef7a56d2062cc76eb0b (diff) | |
download | rails-e3d1585c8f2eb08e9e8bfa283a54a949f0ec5467.tar.gz rails-e3d1585c8f2eb08e9e8bfa283a54a949f0ec5467.tar.bz2 rails-e3d1585c8f2eb08e9e8bfa283a54a949f0ec5467.zip |
add type option to atom feed entry builder
closes #5672
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/atom_feed_helper_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionpack/test/template/atom_feed_helper_test.rb index d26aa9aa85..89aae4ac56 100644 --- a/actionpack/test/template/atom_feed_helper_test.rb +++ b/actionpack/test/template/atom_feed_helper_test.rb @@ -45,6 +45,23 @@ class ScrollsController < ActionController::Base end end EOT + FEEDS["entry_type_options"] = <<-EOT + atom_feed(:schema_date => '2008') do |feed| + feed.title("My great blog!") + feed.updated((@scrolls.first.created_at)) + + @scrolls.each do |scroll| + feed.entry(scroll, :type => 'text/xml') do |entry| + entry.title(scroll.title) + entry.content(scroll.body, :type => 'html') + + entry.author do |author| + author.name("DHH") + end + end + end + end + EOT FEEDS["xml_block"] = <<-EOT atom_feed do |feed| feed.title("My great blog!") @@ -306,6 +323,20 @@ class AtomFeedTest < ActionController::TestCase end end + def test_feed_entry_type_option_default_to_text_html + with_restful_routing(:scrolls) do + get :index, :id => 'defaults' + assert_select "entry link[rel=alternate][type=text/html]" + end + end + + def test_feed_entry_type_option_specified + with_restful_routing(:scrolls) do + get :index, :id => 'entry_type_options' + assert_select "entry link[rel=alternate][type=text/xml]" + end + end + private def with_restful_routing(resources) with_routing do |set| |