From 0de209fdb321819f8ddcf2d850a632b659273d1e Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Sun, 24 Apr 2016 23:07:29 -0300 Subject: [PATCH] Fix functional tests --- test/functional/comment_controller_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/comment_controller_test.rb b/test/functional/comment_controller_test.rb index 08d5365..45545b8 100644 --- a/test/functional/comment_controller_test.rb +++ b/test/functional/comment_controller_test.rb @@ -487,7 +487,7 @@ class CommentControllerTest < ActionController::TestCase should 'edit comment from a page' do login_as profile.identifier page = profile.articles.create!(:name => 'myarticle', :body => 'the body of the text') - comment = fast_create(Comment, :body => 'Original comment', :source_id => page.id, :source_type => 'Article', :author_id => profile.id) + comment = fast_create(Comment, :body => 'Original comment', :source_id => page.id, :source_type => 'Article', :author_id => profile.id, :author_type => 'Person') get :edit, :id => comment.id, :profile => profile.identifier, :comment => { :body => 'Comment edited' } assert_tag :tag => 'textarea', :attributes => {:id => 'comment_body'}, :content => /Original comment/ @@ -522,7 +522,7 @@ class CommentControllerTest < ActionController::TestCase should 'be able to update a comment' do login_as profile.identifier page = profile.articles.create!(:name => 'myarticle', :body => 'the body of the text', :accept_comments => false) - comment = fast_create(Comment, :body => 'Original comment', :source_id => page.id, :source_type => 'Article', :author_id => profile) + comment = fast_create(Comment, :body => 'Original comment', :source_id => page.id, :source_type => 'Article', :author_id => profile, :author_type => 'Person') xhr :post, :update, :id => comment.id, :profile => profile.identifier, :comment => { :body => 'Comment edited' } assert ActiveSupport::JSON.decode(@response.body)["ok"], "attribute ok expected to be true" -- libgit2 0.21.2