Commit 9f59e9402ae678b0137a9e24acc29d2ef7d6340d
Committed by
Antonio Terceiro
1 parent
3d6c66d5
Exists in
master
and in
8 other branches
refactoring test 'update external feed'
Showing
3 changed files
with
11 additions
and
1 deletions
Show diff stats
app/models/rss_feed.rb
lib/acts_as_having_settings.rb
... | ... | @@ -31,6 +31,10 @@ module ActsAsHavingSettings |
31 | 31 | val.nil? ? (#{default}.is_a?(String) ? gettext(#{default}) : #{default}) : val |
32 | 32 | end |
33 | 33 | def #{setting}=(value) |
34 | + | |
35 | + #UPGRADE Leandro: I add this line to save the serialize attribute | |
36 | + send(self.class.settings_field.to_s + '_will_change!') | |
37 | + | |
34 | 38 | send(self.class.settings_field)[:#{setting}] = self.class.acts_as_having_settings_type_cast(value, #{data_type.inspect}) |
35 | 39 | end |
36 | 40 | CODE | ... | ... |
test/unit/blog_test.rb
... | ... | @@ -113,7 +113,11 @@ class BlogTest < ActiveSupport::TestCase |
113 | 113 | should 'update external feed' do |
114 | 114 | p = create_user('testuser').person |
115 | 115 | blog = Blog.new(:profile => p, :name => 'Blog test') |
116 | - blog.create_external_feed(:address => 'feed address') | |
116 | + blog.save | |
117 | + e = ExternalFeed.new(:address => 'feed address') | |
118 | + e.blog = blog | |
119 | + e.save | |
120 | + blog.reload | |
117 | 121 | blog.external_feed_builder = { :address => 'address edited' } |
118 | 122 | blog.save! |
119 | 123 | assert_equal 'address edited', blog.external_feed.address | ... | ... |