Commit d1342c857fd165725338cb72af9efb2eb86465ed

Authored by Victor Costa
1 parent c052ed1e

rails3: fix article_block tests

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
test/unit/article_block_test.rb
@@ -72,13 +72,13 @@ class ArticleBlockTest < ActiveSupport::TestCase @@ -72,13 +72,13 @@ class ArticleBlockTest < ActiveSupport::TestCase
72 72
73 should "take available articles with an environment as the box owner" do 73 should "take available articles with an environment as the box owner" do
74 env = Environment.create!(:name => 'test env') 74 env = Environment.create!(:name => 'test env')
75 - env.articles.destroy_all 75 + env.profiles.each { |profile| profile.articles.destroy_all }
76 assert_equal [], env.articles 76 assert_equal [], env.articles
77 community = fast_create(Community) 77 community = fast_create(Community)
78 a = fast_create(TextArticle, :profile_id => community.id, :name => 'test') 78 a = fast_create(TextArticle, :profile_id => community.id, :name => 'test')
79 env.portal_community=community 79 env.portal_community=community
80 env.save 80 env.save
81 - block = ArticleBlock.create(:article => a) 81 + block = create(ArticleBlock, :article => a)
82 env.boxes.first.blocks << block 82 env.boxes.first.blocks << block
83 block.save! 83 block.save!
84 84