Commit 04be0132d4321dee58494626386fc19d18fd26cd
Committed by
Daniela Feitosa
1 parent
a64cb73c
Exists in
master
and in
28 other branches
Padronize Gallery::to_html() and makes rss happy
(ActionItem1867)
Showing
2 changed files
with
11 additions
and
1 deletions
Show diff stats
app/models/gallery.rb
@@ -9,7 +9,7 @@ class Gallery < Folder | @@ -9,7 +9,7 @@ class Gallery < Folder | ||
9 | end | 9 | end |
10 | 10 | ||
11 | include ActionView::Helpers::TagHelper | 11 | include ActionView::Helpers::TagHelper |
12 | - def to_html(options) | 12 | + def to_html(options={}) |
13 | article = self | 13 | article = self |
14 | lambda do | 14 | lambda do |
15 | render :file => 'content_viewer/image_gallery', :locals => {:article => article} | 15 | render :file => 'content_viewer/image_gallery', :locals => {:article => article} |
test/unit/feed_writer_test.rb
@@ -14,6 +14,16 @@ class FeedWriterTest < Test::Unit::TestCase | @@ -14,6 +14,16 @@ class FeedWriterTest < Test::Unit::TestCase | ||
14 | assert_match('/tagger/' + articles.first.slug, feed) | 14 | assert_match('/tagger/' + articles.first.slug, feed) |
15 | end | 15 | end |
16 | 16 | ||
17 | + should 'generate feed with a gallery' do | ||
18 | + articles = [] | ||
19 | + profile = fast_create(:profile, :identifier => "tagger") | ||
20 | + articles << fast_create(:gallery, :name => 'my pics', :profile_id => profile.id) | ||
21 | + writer = FeedWriter.new | ||
22 | + | ||
23 | + feed = writer.write(articles) | ||
24 | + assert_match('my pics', feed) | ||
25 | + end | ||
26 | + | ||
17 | should 'use title, link and description' do | 27 | should 'use title, link and description' do |
18 | writer = FeedWriter.new | 28 | writer = FeedWriter.new |
19 | rss = writer.write([], :title => "my title", :description => "my description", :link => "http://example.com/") | 29 | rss = writer.write([], :title => "my title", :description => "my description", :link => "http://example.com/") |