[noosfero/noosfero][master] comment_group: fix tests
Victor Costa
gitlab at gitlab.com
Tue Mar 24 14:58:00 BRT 2015
Victor Costa pushed to master at Noosfero / noosfero
Commits:
365042da by Victor Costa at 2015-03-24T14:50:22Z
comment_group: fix tests
- - - - -
1 changed file:
- plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb
Changes:
=====================================
plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb
=====================================
--- 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
@@ -22,8 +22,9 @@ class CommentGroupPluginProfileControllerTest < ActionController::TestCase
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_group_plugin_profile/view_comments'
- assert_match /comments_list_group_0/, @response.body
- assert_match /\"comment-count-0\", \"1\"/, @response.body
+ assert_select_rjs '#comments_list_group_0'
+ assert_select_rjs :replace_html, '#comment-count-0'
+ assert_equal 1, assigns(:comments_count)
end
should 'do not show global comments' do
@@ -31,8 +32,9 @@ class CommentGroupPluginProfileControllerTest < ActionController::TestCase
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_group_plugin_profile/view_comments'
- assert_match /comments_list_group_0/, @response.body
- assert_match /\"comment-count-0\", \"1\"/, @response.body
+ assert_select_rjs '#comments_list_group_0'
+ assert_select_rjs :replace_html, '#comment-count-0'
+ assert_equal 1, assigns(:comments_count)
end
should 'show first page comments only' do
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/365042dabe707ea1c2758b7369851e4ae41a998c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150324/3712b3ed/attachment.html>
More information about the Noosfero-dev
mailing list