Commit 37ca56cd3c93d4a9bbc2bac1c7a07b291d65a4ea
1 parent
50e0a4c3
Exists in
master
and in
28 other branches
ActionItem23: serializing options into body
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1117 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
7 additions
and
2 deletions
Show diff stats
app/models/rss_feed.rb
@@ -3,6 +3,10 @@ class RssFeed < Article | @@ -3,6 +3,10 @@ class RssFeed < Article | ||
3 | # store setting in body | 3 | # store setting in body |
4 | serialize Hash, :body | 4 | serialize Hash, :body |
5 | 5 | ||
6 | + def body | ||
7 | + self[:body] ||= {} | ||
8 | + end | ||
9 | + | ||
6 | # TODO | 10 | # TODO |
7 | def to_html | 11 | def to_html |
8 | end | 12 | end |
test/unit/rss_feed_test.rb
@@ -7,7 +7,8 @@ class RssFeedTest < Test::Unit::TestCase | @@ -7,7 +7,8 @@ class RssFeedTest < Test::Unit::TestCase | ||
7 | end | 7 | end |
8 | 8 | ||
9 | should 'store settings in a hash serialized into body field' do | 9 | should 'store settings in a hash serialized into body field' do |
10 | - flunk 'pending' | 10 | + feed = RssFeed.new |
11 | + assert_kind_of Hash, feed.body | ||
11 | end | 12 | end |
12 | 13 | ||
13 | should 'list recent articles of profile when top-level' do | 14 | should 'list recent articles of profile when top-level' do |
@@ -39,7 +40,7 @@ class RssFeedTest < Test::Unit::TestCase | @@ -39,7 +40,7 @@ class RssFeedTest < Test::Unit::TestCase | ||
39 | flunk 'pending' | 40 | flunk 'pending' |
40 | end | 41 | end |
41 | 42 | ||
42 | - should 'be able to choose if search in all articles or in subarticles of parent' do | 43 | + should 'be able to choose search in all articles or in subarticles of parent' do |
43 | flunk 'pending' | 44 | flunk 'pending' |
44 | end | 45 | end |
45 | 46 |