From c62c8359c6d75ac648a6be74367352f4422d98e8 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Fri, 15 Jan 2016 13:40:11 -0300 Subject: [PATCH] comment_paragraph: fix tests --- plugins/comment_paragraph/test/unit/comment_paragraph_plugin_test.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/comment_paragraph/test/unit/comment_paragraph_plugin_test.rb b/plugins/comment_paragraph/test/unit/comment_paragraph_plugin_test.rb index 42e1092..2fbaf42 100644 --- a/plugins/comment_paragraph/test/unit/comment_paragraph_plugin_test.rb +++ b/plugins/comment_paragraph/test/unit/comment_paragraph_plugin_test.rb @@ -71,7 +71,7 @@ class CommentParagraphPluginTest < ActiveSupport::TestCase article.expects(:allow_edit?).with(user).returns(true) article.expects(:comment_paragraph_plugin_activated?).returns(false) - assert_equal 'Activate Comments', plugin.article_extra_toolbar_buttons(article)[:title] + assert_equal 'Activate Comments', plugin.article_extra_toolbar_buttons(article).first[:title] end should 'display Deactivate Comments title if comment paragraph plugin is deactivated' do @@ -81,7 +81,17 @@ class CommentParagraphPluginTest < ActiveSupport::TestCase article.expects(:allow_edit?).with(user).returns(true) article.expects(:comment_paragraph_plugin_activated?).returns(true) - assert_equal 'Deactivate Comments', plugin.article_extra_toolbar_buttons(article)[:title] + assert_equal 'Deactivate Comments', plugin.article_extra_toolbar_buttons(article).first[:title] + end + + should 'display export comments button when comment paragraph plugin is activated' do + profile = fast_create(Profile) + article = fast_create(Article, :profile_id => profile.id) + article.expects(:comment_paragraph_plugin_enabled?).returns(true) + article.expects(:allow_edit?).with(user).returns(true) + article.expects(:comment_paragraph_plugin_activated?).returns(false) + + assert_equal 'Export Comments', plugin.article_extra_toolbar_buttons(article).last[:title] end end -- libgit2 0.21.2