Commit 0de209fdb321819f8ddcf2d850a632b659273d1e

Authored by Larissa Reis
1 parent 52baa461

Fix functional tests

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
test/functional/comment_controller_test.rb
... ... @@ -487,7 +487,7 @@ class CommentControllerTest < ActionController::TestCase
487 487 should 'edit comment from a page' do
488 488 login_as profile.identifier
489 489 page = profile.articles.create!(:name => 'myarticle', :body => 'the body of the text')
490   - comment = fast_create(Comment, :body => 'Original comment', :source_id => page.id, :source_type => 'Article', :author_id => profile.id)
  490 + comment = fast_create(Comment, :body => 'Original comment', :source_id => page.id, :source_type => 'Article', :author_id => profile.id, :author_type => 'Person')
491 491  
492 492 get :edit, :id => comment.id, :profile => profile.identifier, :comment => { :body => 'Comment edited' }
493 493 assert_tag :tag => 'textarea', :attributes => {:id => 'comment_body'}, :content => /Original comment/
... ... @@ -522,7 +522,7 @@ class CommentControllerTest < ActionController::TestCase
522 522 should 'be able to update a comment' do
523 523 login_as profile.identifier
524 524 page = profile.articles.create!(:name => 'myarticle', :body => 'the body of the text', :accept_comments => false)
525   - comment = fast_create(Comment, :body => 'Original comment', :source_id => page.id, :source_type => 'Article', :author_id => profile)
  525 + comment = fast_create(Comment, :body => 'Original comment', :source_id => page.id, :source_type => 'Article', :author_id => profile, :author_type => 'Person')
526 526  
527 527 xhr :post, :update, :id => comment.id, :profile => profile.identifier, :comment => { :body => 'Comment edited' }
528 528 assert ActiveSupport::JSON.decode(@response.body)["ok"], "attribute ok expected to be true"
... ...