comment_paragraph_plugin_test.rb
1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require File.dirname(__FILE__) + '/../test_helper'
include ActionView::Helpers::FormTagHelper
class CommentParagraphPluginTest < ActiveSupport::TestCase
def setup
@environment = Environment.default
@plugin = CommentParagraphPlugin.new
end
attr_reader :environment, :plugin
should 'have a name' do
assert_not_equal Noosfero::Plugin.plugin_name, CommentParagraphPlugin::plugin_name
end
should 'describe yourself' do
assert_not_equal Noosfero::Plugin.plugin_description, CommentParagraphPlugin::plugin_description
end
should 'have a js file' do
assert !plugin.js_files.blank?
end
should 'have stylesheet' do
assert plugin.stylesheet?
end
should 'not add comment_paragraph_selected_area if comment_paragraph_selected_area is blank' do
comment = Comment.new
comment.comment_paragraph_selected_area = ""
comment.paragraph_uuid = 2
cpp = CommentParagraphPlugin.new
prok = cpp.comment_form_extra_contents({:comment=>comment, :paragraph_uuid=>4})
assert_nil /comment_paragraph_selected_area/.match(prok.call.inspect)
end
end