Commit 724a52cb2ff516d608acc0336c2271195607b592
1 parent
ecf5200d
Exists in
master
and in
29 other branches
Fix comment group plugin tests
Showing
2 changed files
with
9 additions
and
9 deletions
Show diff stats
plugins/comment_group/controllers/profile/comment_group_plugin_profile_controller.rb
1 | class CommentGroupPluginProfileController < ProfileController | 1 | class CommentGroupPluginProfileController < ProfileController |
2 | - append_view_path File.join(File.dirname(__FILE__) + '/../views') | 2 | + append_view_path File.join(File.dirname(__FILE__) + '/../../views') |
3 | 3 | ||
4 | def view_comments | 4 | def view_comments |
5 | @article_id = params[:article_id] | 5 | @article_id = params[:article_id] |
plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb
@@ -21,25 +21,25 @@ class CommentGroupPluginProfileControllerTest < ActionController::TestCase | @@ -21,25 +21,25 @@ class CommentGroupPluginProfileControllerTest < ActionController::TestCase | ||
21 | should 'be able to show group comments' do | 21 | should 'be able to show group comments' do |
22 | comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'lalala', :group_id => 0) | 22 | comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'lalala', :group_id => 0) |
23 | xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 | 23 | xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 |
24 | - assert_template 'comment/_comment.rhtml' | 24 | + assert_template 'comment_group_plugin_profile/view_comments.rjs' |
25 | assert_match /comments_list_group_0/, @response.body | 25 | assert_match /comments_list_group_0/, @response.body |
26 | assert_match /\"comment-count-0\", \"1\"/, @response.body | 26 | assert_match /\"comment-count-0\", \"1\"/, @response.body |
27 | end | 27 | end |
28 | 28 | ||
29 | should 'do not show global comments' do | 29 | should 'do not show global comments' do |
30 | - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'global comment', :body => 'global', :group_id => nil) | ||
31 | - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'lalala', :group_id => 0) | 30 | + fast_create(Comment, :source_id => article, :author_id => profile, :title => 'global comment', :body => 'global', :group_id => nil) |
31 | + fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'lalala', :group_id => 0) | ||
32 | xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 | 32 | xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 |
33 | - assert_template 'comment/_comment.rhtml' | 33 | + assert_template 'comment_group_plugin_profile/view_comments.rjs' |
34 | assert_match /comments_list_group_0/, @response.body | 34 | assert_match /comments_list_group_0/, @response.body |
35 | assert_match /\"comment-count-0\", \"1\"/, @response.body | 35 | assert_match /\"comment-count-0\", \"1\"/, @response.body |
36 | end | 36 | end |
37 | 37 | ||
38 | should 'show first page comments only' do | 38 | should 'show first page comments only' do |
39 | - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 1', :group_id => 0) | ||
40 | - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 2', :group_id => 0) | ||
41 | - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 3', :group_id => 0) | ||
42 | - comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'secondpage', :body => 'secondpage', :group_id => 0) | 39 | + comment1 = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'secondpage', :group_id => 0) |
40 | + comment2 = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 1', :group_id => 0) | ||
41 | + comment3 = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 2', :group_id => 0) | ||
42 | + comment4 = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'firstpage 3', :group_id => 0) | ||
43 | xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 | 43 | xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 |
44 | assert_match /firstpage 1/, @response.body | 44 | assert_match /firstpage 1/, @response.body |
45 | assert_match /firstpage 2/, @response.body | 45 | assert_match /firstpage 2/, @response.body |