diff options
Diffstat (limited to 'actionpack/test/template/atom_feed_helper_test.rb')
-rw-r--r-- | actionpack/test/template/atom_feed_helper_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionpack/test/template/atom_feed_helper_test.rb index 9efc29fbdf..9f7e5b4c6c 100644 --- a/actionpack/test/template/atom_feed_helper_test.rb +++ b/actionpack/test/template/atom_feed_helper_test.rb @@ -55,6 +55,25 @@ class ScrollsController < ActionController::Base end end EOT + FEEDS["feed_with_atomPub_namespace"] = <<-EOT + atom_feed({'xmlns:app' => 'http://www.w3.org/2007/app', + 'xmlns:openSearch' => 'http://a9.com/-/spec/opensearch/1.1/'}) 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.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)), @@ -139,6 +158,15 @@ class AtomFeedTest < Test::Unit::TestCase end end + def test_feed_should_include_atomPub_namespace + with_restful_routing(:scrolls) do + get :index, :id => "feed_with_atomPub_namespace" + assert_match %r{xml:lang="en-US"}, @response.body + assert_match %r{xmlns="http://www.w3.org/2005/Atom"}, @response.body + assert_match %r{xmlns:app="http://www.w3.org/2007/app"}, @response.body + end + end + private def with_restful_routing(resources) with_routing do |set| |