diff options
author | Michael Koziarski <michael@koziarski.com> | 2008-01-13 00:11:39 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-01-13 00:11:39 +0000 |
commit | 7e1c04d86691075d172bccb8bc1c7df2e71383c3 (patch) | |
tree | d37e3f008d774ba8210babf7137ad4f01ee1416a /actionpack/test/template | |
parent | 772ad9520158fb35fd5d5a9357ceca51b297bd67 (diff) | |
download | rails-7e1c04d86691075d172bccb8bc1c7df2e71383c3.tar.gz rails-7e1c04d86691075d172bccb8bc1c7df2e71383c3.tar.bz2 rails-7e1c04d86691075d172bccb8bc1c7df2e71383c3.zip |
Allow users to declare other namespaces when using the atom feed helpers. Closes #10304 [david.calavera]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8637 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-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| |