Commit 2cd9bf00797e02babb3329a7a9856afd0f14d6a0
Exists in
master
and in
28 other branches
Merge branch 'stable'
Showing
5 changed files
with
21 additions
and
8 deletions
Show diff stats
INSTALL
| ... | ... | @@ -237,6 +237,10 @@ Create the database structure: |
| 237 | 237 | |
| 238 | 238 | $ RAILS_ENV=production rake db:schema:load |
| 239 | 239 | |
| 240 | +Compile the translations: | |
| 241 | + | |
| 242 | +$ RAILS_ENV=production rake noosfero:translations:compile | |
| 243 | + | |
| 240 | 244 | Now we have to create some initial data. To create your default environment |
| 241 | 245 | (the first one), run the command below: |
| 242 | 246 | |
| ... | ... | @@ -258,10 +262,6 @@ $ RAILS_ENV=production ./script/runner "User.create(:login => 'adminuser', :emai |
| 258 | 262 | (replace "adminuser", "admin@example.com", "admin" with the login, email |
| 259 | 263 | and password of your environment admin) |
| 260 | 264 | |
| 261 | -Compile the translations: | |
| 262 | - | |
| 263 | -$ RAILS_ENV=production rake noosfero:translations:compile | |
| 264 | - | |
| 265 | 265 | To start the Noosfero application servers: |
| 266 | 266 | |
| 267 | 267 | $ ./script/production start | ... | ... |
app/helpers/application_helper.rb
| ... | ... | @@ -1154,7 +1154,7 @@ module ApplicationHelper |
| 1154 | 1154 | def render_environment_features(folder) |
| 1155 | 1155 | result = '' |
| 1156 | 1156 | environment.enabled_features.keys.each do |feature| |
| 1157 | - file = File.join(@controller.view_paths, 'shared', folder.to_s, "#{feature}.rhtml") | |
| 1157 | + file = File.join(@controller.view_paths.last, 'shared', folder.to_s, "#{feature}.rhtml") | |
| 1158 | 1158 | if File.exists?(file) |
| 1159 | 1159 | result << render(:file => file, :use_full_path => false) |
| 1160 | 1160 | end | ... | ... |
app/models/feed_reader_block.rb
| ... | ... | @@ -13,6 +13,7 @@ class FeedReaderBlock < Block |
| 13 | 13 | old_address = address |
| 14 | 14 | orig_set_address(new_address) |
| 15 | 15 | self.enabled = (new_address && new_address != old_address) || (new_address && self.enabled) || false |
| 16 | + self.fetched_at = nil | |
| 16 | 17 | end |
| 17 | 18 | |
| 18 | 19 | settings_items :limit, :type => :integer |
| ... | ... | @@ -71,6 +72,7 @@ class FeedReaderBlock < Block |
| 71 | 72 | self.feed_title = nil |
| 72 | 73 | self.error_message = nil |
| 73 | 74 | end |
| 75 | + | |
| 74 | 76 | def finish_fetch |
| 75 | 77 | self.fetched_at = Time.now |
| 76 | 78 | self.save! | ... | ... |
test/unit/application_helper_test.rb
| ... | ... | @@ -603,7 +603,7 @@ class ApplicationHelperTest < Test::Unit::TestCase |
| 603 | 603 | |
| 604 | 604 | @controller = ApplicationController.new |
| 605 | 605 | path = File.join(RAILS_ROOT, 'app', 'views') |
| 606 | - @controller.stubs(:view_paths).returns(path) | |
| 606 | + @controller.stubs(:view_paths).returns([path]) | |
| 607 | 607 | |
| 608 | 608 | file = path + '/shared/usermenu/xmpp_chat.rhtml' |
| 609 | 609 | expects(:render).with(:file => file, :use_full_path => false).returns('Open chat') | ... | ... |
test/unit/feed_reader_block_test.rb
| ... | ... | @@ -127,7 +127,7 @@ class FeedReaderBlockTest < ActiveSupport::TestCase |
| 127 | 127 | Time.stubs(:now).returns(now - 3.hours) |
| 128 | 128 | not_expired.finish_fetch |
| 129 | 129 | |
| 130 | - # now one block should be expired and the not the other | |
| 130 | + # now one block should be expired and not the other | |
| 131 | 131 | Time.stubs(:now).returns(now) |
| 132 | 132 | expired_list = FeedReaderBlock.expired |
| 133 | 133 | assert_includes expired_list, expired |
| ... | ... | @@ -156,6 +156,17 @@ class FeedReaderBlockTest < ActiveSupport::TestCase |
| 156 | 156 | assert_equal true, reader.enabled |
| 157 | 157 | end |
| 158 | 158 | |
| 159 | + should 'be expired when address is updated' do | |
| 160 | + reader = build(:feed_reader_block, :address => 'http://www.example.com/feed') | |
| 161 | + reader.finish_fetch | |
| 162 | + expired_list = FeedReaderBlock.expired | |
| 163 | + assert_not_includes expired_list, reader | |
| 164 | + reader.address = "http://www.example.com/new-feed" | |
| 165 | + reader.save! | |
| 166 | + expired_list = FeedReaderBlock.expired | |
| 167 | + assert_includes expired_list, reader | |
| 168 | + end | |
| 169 | + | |
| 159 | 170 | should 'be disabled when address is empty' do |
| 160 | 171 | reader = build(:feed_reader_block, :enabled => true, :address => 'http://www.example.com/feed') |
| 161 | 172 | reader.address = nil |
| ... | ... | @@ -173,7 +184,7 @@ class FeedReaderBlockTest < ActiveSupport::TestCase |
| 173 | 184 | assert_equal true, reader.enabled, 'must enable when setting to new address' |
| 174 | 185 | end |
| 175 | 186 | |
| 176 | - should 'kepp enable when address is not changed' do | |
| 187 | + should 'keep enable when address is not changed' do | |
| 177 | 188 | reader = build(:feed_reader_block, :address => 'http://www.example.com/feed') |
| 178 | 189 | reader.address = 'http://www.example.com/feed' |
| 179 | 190 | assert_equal true, reader.enabled | ... | ... |