Commit 365042dabe707ea1c2758b7369851e4ae41a998c
1 parent
577ce21b
Exists in
master
and in
29 other branches
comment_group: fix tests
Showing
1 changed file
with
6 additions
and
4 deletions
Show diff stats
plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb
... | ... | @@ -22,8 +22,9 @@ class CommentGroupPluginProfileControllerTest < ActionController::TestCase |
22 | 22 | comment = fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'lalala', :group_id => 0) |
23 | 23 | xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 |
24 | 24 | assert_template 'comment_group_plugin_profile/view_comments' |
25 | - assert_match /comments_list_group_0/, @response.body | |
26 | - assert_match /\"comment-count-0\", \"1\"/, @response.body | |
25 | + assert_select_rjs '#comments_list_group_0' | |
26 | + assert_select_rjs :replace_html, '#comment-count-0' | |
27 | + assert_equal 1, assigns(:comments_count) | |
27 | 28 | end |
28 | 29 | |
29 | 30 | should 'do not show global comments' do |
... | ... | @@ -31,8 +32,9 @@ class CommentGroupPluginProfileControllerTest < ActionController::TestCase |
31 | 32 | fast_create(Comment, :source_id => article, :author_id => profile, :title => 'a comment', :body => 'lalala', :group_id => 0) |
32 | 33 | xhr :get, :view_comments, :profile => @profile.identifier, :article_id => article.id, :group_id => 0 |
33 | 34 | assert_template 'comment_group_plugin_profile/view_comments' |
34 | - assert_match /comments_list_group_0/, @response.body | |
35 | - assert_match /\"comment-count-0\", \"1\"/, @response.body | |
35 | + assert_select_rjs '#comments_list_group_0' | |
36 | + assert_select_rjs :replace_html, '#comment-count-0' | |
37 | + assert_equal 1, assigns(:comments_count) | |
36 | 38 | end |
37 | 39 | |
38 | 40 | should 'show first page comments only' do | ... | ... |