Commit 4456c409392bd3096f0684ee58a7a31aa6f3ee8d
Exists in
staging
and in
42 other branches
Merge branch 'stable'
Showing
5 changed files
with
12 additions
and
3 deletions
Show diff stats
app/models/feed_reader_block.rb
| ... | ... | @@ -12,7 +12,7 @@ class FeedReaderBlock < Block |
| 12 | 12 | def address=(new_address) |
| 13 | 13 | old_address = address |
| 14 | 14 | orig_set_address(new_address) |
| 15 | - self.enabled = (old_address.blank? && !new_address.blank?) || (new_address && new_address != old_address) || false | |
| 15 | + self.enabled = (new_address && new_address != old_address) || (new_address && self.enabled) || false | |
| 16 | 16 | end |
| 17 | 17 | |
| 18 | 18 | settings_items :limit, :type => :integer | ... | ... |
lib/noosfero.rb
test/fixtures/environments.yml
test/test_helper.rb
| ... | ... | @@ -15,6 +15,9 @@ FileUtils.rm_rf(File.join(RAILS_ROOT, 'index', 'test')) |
| 15 | 15 | Image.attachment_options[:path_prefix] = 'test/tmp/public/images' |
| 16 | 16 | Thumbnail.attachment_options[:path_prefix] = 'test/tmp/public/thumbnails' |
| 17 | 17 | |
| 18 | +FastGettext.add_text_domain 'noosferotest', :type => :chain, :chain => [] | |
| 19 | +FastGettext.default_text_domain = 'noosferotest' | |
| 20 | + | |
| 18 | 21 | class Test::Unit::TestCase |
| 19 | 22 | # Transactional fixtures accelerate your tests by wrapping each test method |
| 20 | 23 | # in a transaction that's rolled back on completion. This ensures that the | ... | ... |
test/unit/feed_reader_block_test.rb
| ... | ... | @@ -173,4 +173,10 @@ class FeedReaderBlockTest < ActiveSupport::TestCase |
| 173 | 173 | assert_equal true, reader.enabled, 'must enable when setting to new address' |
| 174 | 174 | end |
| 175 | 175 | |
| 176 | + should 'kepp enable when address is not changed' do | |
| 177 | + reader = build(:feed_reader_block, :address => 'http://www.example.com/feed') | |
| 178 | + reader.address = 'http://www.example.com/feed' | |
| 179 | + assert_equal true, reader.enabled | |
| 180 | + end | |
| 181 | + | |
| 176 | 182 | end | ... | ... |