Commit f57bb5bd246ca624f299e1b12011b3452059440b

Authored by MoisesMachado
1 parent d42992d2

ActionItem673: fixed coping of homepage from template

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/branches/0.11.x@2498 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/profile.rb
... ... @@ -334,7 +334,6 @@ class Profile < ActiveRecord::Base
334 334 hp.profile = self
335 335 hp.save!
336 336 self.home_page = hp
337   - self.save!
338 337  
339 338 # a default rss feed
340 339 feed = RssFeed.new(:name => 'feed')
... ... @@ -346,6 +345,7 @@ class Profile < ActiveRecord::Base
346 345 self.articles << folder
347 346 end
348 347 end
  348 + self.save!
349 349 end
350 350  
351 351 def copy_articles_from other
... ...
test/unit/profile_test.rb
... ... @@ -849,6 +849,7 @@ class ProfileTest &lt; Test::Unit::TestCase
849 849 Profile.any_instance.stubs(:template).returns(template)
850 850  
851 851 p = Profile.create!(:name => 'test_profile', :identifier => 'test_profile')
  852 + p.reload
852 853  
853 854 assert_not_nil p.home_page
854 855 assert_equal 'some xyz article', p.home_page.name
... ...