Commit e15c8cea36d7605038e4b6af161776a9b0fb6e46

Authored by Victor Costa
1 parent a27c7333

rails3: fix tests in article_test related to profile assignment

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
test/unit/article_test.rb
@@ -419,7 +419,7 @@ class ArticleTest < ActiveSupport::TestCase @@ -419,7 +419,7 @@ class ArticleTest < ActiveSupport::TestCase
419 c2 = fast_create(Category, :environment_id => Environment.default.id, :name => 'c2') 419 c2 = fast_create(Category, :environment_id => Environment.default.id, :name => 'c2')
420 420
421 p = create_user('testinguser').person 421 p = create_user('testinguser').person
422 - a = create(Article, :name => 'test', :category_ids => [c1.id, c2.id], :profile_id => p) 422 + a = create(Article, :name => 'test', :category_ids => [c1.id, c2.id], :profile_id => p.id)
423 423
424 assert_equivalent [c1, c2], a.categories(true) 424 assert_equivalent [c1, c2], a.categories(true)
425 assert_includes a.categories_including_virtual(true), parent1 425 assert_includes a.categories_including_virtual(true), parent1
@@ -430,7 +430,7 @@ class ArticleTest < ActiveSupport::TestCase @@ -430,7 +430,7 @@ class ArticleTest < ActiveSupport::TestCase
430 c2 = create(Category, :environment => Environment.default, :name => 'c2', :parent_id => c1.id) 430 c2 = create(Category, :environment => Environment.default, :name => 'c2', :parent_id => c1.id)
431 c3 = create(Category, :environment => Environment.default, :name => 'c3', :parent_id => c1.id) 431 c3 = create(Category, :environment => Environment.default, :name => 'c3', :parent_id => c1.id)
432 owner = create_user('testuser').person 432 owner = create_user('testuser').person
433 - art = create(Article, :name => 'ytest', :profile_id => owner) 433 + art = create(Article, :name => 'ytest', :profile_id => owner.id)
434 art.category_ids = [c2,c3,c3].map(&:id) 434 art.category_ids = [c2,c3,c3].map(&:id)
435 435
436 categories = art.categories(true) 436 categories = art.categories(true)
@@ -559,7 +559,7 @@ class ArticleTest < ActiveSupport::TestCase @@ -559,7 +559,7 @@ class ArticleTest < ActiveSupport::TestCase
559 should 'make a copy of the article to other profile' do 559 should 'make a copy of the article to other profile' do
560 p1 = create_user('test_user1').person 560 p1 = create_user('test_user1').person
561 p2 = create_user('test_user2').person 561 p2 = create_user('test_user2').person
562 - a = create(Article, :name => 'test article', :body => 'some text', :profile_id => p1) 562 + a = create(Article, :name => 'test article', :body => 'some text', :profile_id => p1.id)
563 b = a.copy(:parent => a, :profile => p2) 563 b = a.copy(:parent => a, :profile => p2)
564 564
565 p2 = Person.find(p2.id) 565 p2 = Person.find(p2.id)