From 724a52cb2ff516d608acc0336c2271195607b592 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Wed, 20 Nov 2013 13:32:12 -0300 Subject: [PATCH] Fix comment group plugin tests --- plugins/comment_group/controllers/profile/comment_group_plugin_profile_controller.rb | 2 +- plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/comment_group/controllers/profile/comment_group_plugin_profile_controller.rb b/plugins/comment_group/controllers/profile/comment_group_plugin_profile_controller.rb index 685107c..8fee558 100644 --- a/plugins/comment_group/controllers/profile/comment_group_plugin_profile_controller.rb +++ b/plugins/comment_group/controllers/profile/comment_group_plugin_profile_controller.rb @@ -1,5 +1,5 @@ class CommentGroupPluginProfileController < ProfileController - append_view_path File.join(File.dirname(__FILE__) + '/../views') + append_view_path File.join(File.dirname(__FILE__) + '/../../views') def view_comments @article_id = params[:article_id] diff --git a/plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb b/plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb index 9c5f555..e119a77 100644 --- a/plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb +++ b/plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb @@ -21,25 +21,25 @@ class CommentGroupPluginProfileControllerTest < ActionController::TestCase should 'be able to show group comments' do comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'lalala', :group_id => 0) xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 - assert_template 'comment/_comment.rhtml' + assert_template 'comment_group_plugin_profile/view_comments.rjs' assert_match /comments_list_group_0/, @response.body assert_match /\"comment-count-0\", \"1\"/, @response.body end should 'do not show global comments' do - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'global comment', :body => 'global', :group_id => nil) - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'lalala', :group_id => 0) + fast_create(Comment, :source_id => article, :author_id => profile, :title => 'global comment', :body => 'global', :group_id => nil) + fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'lalala', :group_id => 0) xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 - assert_template 'comment/_comment.rhtml' + assert_template 'comment_group_plugin_profile/view_comments.rjs' assert_match /comments_list_group_0/, @response.body assert_match /\"comment-count-0\", \"1\"/, @response.body end should 'show first page comments only' do - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 1', :group_id => 0) - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 2', :group_id => 0) - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 3', :group_id => 0) - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'secondpage', :body => 'secondpage', :group_id => 0) + comment1 = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'secondpage', :group_id => 0) + comment2 = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 1', :group_id => 0) + comment3 = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 2', :group_id => 0) + comment4 = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 3', :group_id => 0) xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 assert_match /firstpage 1/, @response.body assert_match /firstpage 2/, @response.body -- libgit2 0.21.2