radiant-comments-extension 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/.gitignore +1 -1
  2. data/CHANGELOG +6 -0
  3. data/Gemfile +4 -0
  4. data/README.rdoc +9 -0
  5. data/Rakefile +0 -16
  6. data/TODO +0 -1
  7. data/app/controllers/admin/comments_controller.rb +1 -5
  8. data/app/controllers/comments_controller.rb +46 -4
  9. data/app/models/akismet_spam_filter.rb +1 -1
  10. data/app/models/comment.rb +7 -1
  11. data/app/models/mollom_spam_filter.rb +17 -7
  12. data/app/models/spam_filter.rb +1 -0
  13. data/app/views/admin/comments/_comment.html.haml +26 -0
  14. data/app/views/admin/comments/_form.html.haml +37 -0
  15. data/app/views/admin/comments/edit.html.haml +4 -0
  16. data/app/views/admin/comments/index.html.haml +57 -0
  17. data/app/views/admin/pages/{_comments.rhtml → _comments.html.haml} +0 -0
  18. data/app/views/admin/pages/_edit_comments_enabled.html.haml +7 -0
  19. data/app/views/admin/pages/_index_head_view_comments.html.haml +1 -0
  20. data/app/views/admin/pages/_index_view_comments.html.haml +7 -0
  21. data/comments_extension.rb +11 -27
  22. data/config/locales/en.yml +26 -0
  23. data/config/locales/nl.yml +26 -0
  24. data/config/routes.rb +16 -0
  25. data/db/migrate/002_create_snippets.rb +4 -4
  26. data/lib/comment_page_extensions.rb +15 -2
  27. data/lib/comment_tags.rb +55 -0
  28. data/lib/radiant-comments-extension.rb +2 -0
  29. data/lib/radiant-comments-extension/version.rb +3 -0
  30. data/public/stylesheets/admin/comments.css +21 -29
  31. data/radiant-comments-extension.gemspec +8 -117
  32. data/spec/controllers/page_postback_spec.rb +2 -1
  33. data/spec/models/comment_spec.rb +7 -23
  34. data/spec/models/mollom_spam_filter_spec.rb +5 -0
  35. metadata +30 -32
  36. data/VERSION +0 -1
  37. data/app/views/admin/comments/_comment.rhtml +0 -34
  38. data/app/views/admin/comments/_form.rhtml +0 -36
  39. data/app/views/admin/comments/edit.rhtml +0 -5
  40. data/app/views/admin/comments/index.rhtml +0 -55
  41. data/app/views/admin/pages/_edit_comments_enabled.rhtml +0 -8
  42. data/app/views/admin/pages/_index_head_view_comments.rhtml +0 -1
  43. data/app/views/admin/pages/_index_view_comments.rhtml +0 -11
  44. data/app/views/comments/_comment.rhtml +0 -1
  45. data/app/views/comments/_form.rhtml +0 -23
  46. data/app/views/comments/_new.rhtml +0 -5
  47. data/lib/mollom.rb +0 -246
@@ -0,0 +1,26 @@
1
+ en:
2
+ actions: Actions
3
+ allow_comments_on_page: Allow Comments on this page?
4
+ author: Author
5
+ approve_comment: Approve comment
6
+ are_you_sure_you_want_to_delete_this_comment: Are you sure you want to delete this comment?
7
+ click_to_toggle: Click to toggle complete text
8
+ currently_x_view_comments: Currently {{count}} - show reactions
9
+ comment: Comment
10
+ comments: Comments
11
+ comment_form: Comment Form
12
+ comment_states:
13
+ all: All
14
+ unapproved: Unapproved
15
+ approved: Approved
16
+ date_string: Date
17
+ delete_comment: Delete comment
18
+ delete_unapproved: Delete unapproved comments
19
+ download_csv: Download CSV
20
+ edit_comment: Edit comment
21
+ edit_comment_on: Edit comment on
22
+ email: E-mail
23
+ message_unsure: Please type the letters that you see to prove that you are not a spambot
24
+ unapprove_comment: Unapprove comment
25
+ url: URL
26
+ your_name: Your Name (as you'd like it to appear on this comment)
@@ -0,0 +1,26 @@
1
+ nl:
2
+ actions: Acties
3
+ allow_comments_on_page: Reacties toelaten?
4
+ author: Auteur
5
+ approve_comment: Reactie goedkeuren
6
+ are_you_sure_you_want_to_delete_this_comment: Ben je zeker dat je deze reactie wilt verwijderen?
7
+ click_to_toggle: Klik om de volledige reactie te tonen
8
+ currently_x_view_comments: Momenteel {{count}} - toon reacties
9
+ comment: Reactie
10
+ comments: Reacties
11
+ comment_form: Reactieformulier
12
+ comment_states:
13
+ all: Alle
14
+ unapproved: Te modereren
15
+ approved: Doorgelaten
16
+ date_string: Datum
17
+ delete_comment: Reactie verwijderen
18
+ delete_unapproved: Te modereren reacties verwijderen
19
+ download_csv: CSV downloaden
20
+ edit_comment: Wijzig reactie
21
+ edit_comment_on: Wijzig reactie op
22
+ email: E-mail
23
+ message_unsure: Vul onderstaande CAPTCHA in om te bewijzen dat je geen spam-bot bent
24
+ unapprove_comment: Reactie terug naar Te modereren
25
+ url: URL
26
+ your_name: Naam (die je bij deze reactie wilt tonen)
data/config/routes.rb ADDED
@@ -0,0 +1,16 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+ map.namespace :admin do |admin|
3
+ admin.connect 'comments/:status', :controller => 'comments', :status => 'unapproved', :conditions => { :method => :get }, :requirements => { :status => /all|unapproved|approved/ }
4
+ admin.connect 'comments/:status.:format', :controller => 'comments', :status => /all|approved|unapproved/, :conditions => { :method => :get }
5
+ admin.resources :comments, :member => { :remove => :get, :approve => :put, :unapprove => :put }, :collection => {:destroy_unapproved => :delete}
6
+ admin.page_enable_comments '/pages/:page_id/comments/enable', :controller => 'comments', :action => 'enable', :conditions => {:method => :put}
7
+ end
8
+ map.with_options(:controller => 'admin/comments') do |comments|
9
+ comments.connect 'admin/pages/:page_id/comments/:status', :status => /all|approved|unapproved/, :conditions => { :method => :get }
10
+ comments.connect 'admin/pages/:page_id/comments/:status.:format', :status => /all|approved|unapproved/, :conditions => { :method => :get }
11
+ comments.admin_page_comments 'admin/pages/:page_id/comments/:action'
12
+ comments.admin_page_comment 'admin/pages/:page_id/comments/:id/:action'
13
+ end
14
+ # This needs to be last, otherwise it hoses the admin routes.
15
+ map.resources :comments, :name_prefix => "page_", :path_prefix => "*url", :controller => "comments"
16
+ end
@@ -77,20 +77,20 @@ CONTENT
77
77
  <r:error><p style="color:red">Please correct the errors below.</p></r:error>
78
78
  <p><label for="comment_author">Your Name</label><br />
79
79
  <r:error on="author"><p style="color:red">Name <r:message /></p></r:error>
80
- <r:text_field_tag name="author" id="author" class="required" /></p>
80
+ <p><r:text_field_tag name="author" id="author" class="required" /></p>
81
81
 
82
82
  <p><label for="comment_author_email">Your Email Address</label> (required, but not displayed)<br />
83
83
  <r:error on="author_email"><p style="color:red">Email <r:message /></p></r:error>
84
- <r:text_field_tag name="author_email" class="required" /></p>
84
+ <p><r:text_field_tag name="author_email" class="required" /></p>
85
85
 
86
86
  <p><label for="comment_author_url">Your Web Address</label> (optional)<br />
87
87
  <r:error on="author_url"><p style="color:red">Web Address <r:message /></p></r:error>
88
- <r:text_field_tag name="author_url" /></p>
88
+ <p><r:text_field_tag name="author_url" /></p>
89
89
 
90
90
  <p><label for="comment_content">Your Comment</label><br />
91
91
  <r:error on="content"><p style="color:red">Comment <r:message /></p></r:error>
92
92
  <label for="comment_filter_id">Filter: <r:filter_box_tag name="filter_id" value="Textile" /></label><br />
93
- <r:text_area_tag name="content" class="required" rows="9" cols="40" /></p>
93
+ <p><r:text_area_tag name="content" class="required" rows="9" cols="40" /></p>
94
94
 
95
95
  <r:if_comments_simple_spam_filter_enabled>
96
96
  <r:snippet name="comment_spam_block" />
@@ -6,6 +6,9 @@ module CommentPageExtensions
6
6
  has_many :comments, :dependent => :delete_all, :order => "created_at ASC"
7
7
  attr_accessor :last_comment
8
8
  attr_accessor :selected_comment
9
+ attr_accessor :captcha_url
10
+ attr_accessor :comment_mollom_id
11
+ attr_accessor :posted_comment_is_spam
9
12
  end
10
13
  end
11
14
 
@@ -29,13 +32,23 @@ module CommentPageExtensions
29
32
  absolute_url = "#{request.protocol}#{request.host_with_port}#{relative_url_for(url, request)}#comment-#{comment.id}"
30
33
  response.redirect(absolute_url, 303)
31
34
  return
32
- else
33
- self.selected_comment = comment
35
+ elsif Comment.spam_filter == MollomSpamFilter && MollomSpamFilter.mollom_response(comment).to_s == 'unsure'
36
+ self.last_comment = comment
37
+ captcha = MollomSpamFilter.mollom.image_captcha
38
+ comment.update_attribute(:mollom_id, captcha['session_id']) # because mollom does not guarantee the session_id will be kept when you pass one to mollom.image_captcha
39
+ self.captcha_url = captcha['url']
40
+ self.comment_mollom_id = captcha['session_id']
34
41
  end
42
+ rescue Mollom::NoAvailableServers
43
+ logger.error "*** Mollom was unavailable (Mollom::NoAvailableServers)"
35
44
  rescue ActiveRecord::RecordInvalid
36
45
  self.last_comment = comment
46
+ rescue SpamFilter::Spam
47
+ self.posted_comment_is_spam = true
48
+ comment.destroy
37
49
  end
38
50
  end
39
51
  process_without_comments(request, response)
40
52
  end
53
+
41
54
  end
data/lib/comment_tags.rb CHANGED
@@ -206,6 +206,61 @@ module CommentTags
206
206
  tag 'comments:error:message' do |tag|
207
207
  tag.locals.error_message
208
208
  end
209
+
210
+ desc %{
211
+ Renders the nested content if the posted comment was found unsure by Mollom.
212
+ }
213
+ tag "comments:if_unsure" do |tag|
214
+ tag.expand if tag.locals.page.captcha_url
215
+ end
216
+ desc %{
217
+ Renders the nested content unless the posted comment was found unsure by Mollom.
218
+ }
219
+ tag "comments:unless_unsure" do |tag|
220
+ tag.expand unless tag.locals.page.captcha_url
221
+ end
222
+
223
+ desc %{
224
+ Renders a CAPTCHA if the posted comment was found unsure by Mollom.
225
+
226
+ *Usage:*
227
+ <r:comments:mollom_captcha [label="hey.. are you even human?"] />
228
+ }
229
+ tag "comments:mollom_captcha" do |tag|
230
+ if tag.locals.page.captcha_url
231
+ url = tag.locals.page.captcha_url
232
+ text = tag.attr['label']||I18n.t('message_unsure')
233
+ return %{
234
+ <div id="captcha_form">
235
+ <form method="post" action="#{tag.locals.page.url}comments/solve_captcha">
236
+ <label for="captcha_answer">#{text}</label>
237
+ <img src="#{url}" alt="Mollom image CAPTCHA" /><br />
238
+ <input type="text" name="captcha_answer" />
239
+ <input type="hidden" name="comment_mollom_id" value="#{tag.locals.page.comment_mollom_id}"/>
240
+ <input type="submit" />
241
+ </form>
242
+ </div>
243
+ }
244
+ end
245
+ end
246
+
247
+ desc %{
248
+ Only expands if the posted comment is thought to be spam.
249
+
250
+ *Usage:*
251
+ <pre><code><r:comments:if_spam message="we don't like your spamming around here.." /></code></pre>
252
+ or use a double tag to send your own content:
253
+ <pre><code><r:comments:if_spam>&lt;p class="error">...&lt;/p></r:comments:if_spam></code></pre>
254
+ }
255
+ tag "comments:if_spam" do |tag|
256
+ if tag.locals.page.posted_comment_is_spam == true
257
+ if tag.double?
258
+ tag.expand
259
+ else
260
+ tag.attr["message"]
261
+ end
262
+ end
263
+ end
209
264
 
210
265
  %w(text password hidden).each do |type|
211
266
  desc %{Builds a #{type} form field for comments.}
@@ -0,0 +1,2 @@
1
+ module RadiantCommentsExtension
2
+ end
@@ -0,0 +1,3 @@
1
+ module RadiantCommentsExtension
2
+ VERSION = '0.0.8'
3
+ end
@@ -1,41 +1,33 @@
1
- #comment-nav {
2
- float: right;
1
+ .comment-nav {
2
+ background: #ccc;
3
+ border-top: 1px solid #ccc;
4
+ border-bottom: 1px solid #ccc;
3
5
  list-style: none;
4
- margin: -42px 0 0 96px;
5
- padding: 0; }
6
- #comment-nav li {
6
+ margin: 0;
7
+ padding: 10px; }
8
+ .comment-nav li {
7
9
  display: inline;
8
10
  margin: 0 5px 0 0; }
9
- #comment-nav a, #comment-nav span {
11
+ .comment-nav a, .comment-nav span {
10
12
  padding: 5px 5px 5px 25px;
11
13
  background-position: 5px center;
12
14
  background-repeat: no-repeat; }
13
- #comment-nav a, #comment-nav a:visited {
15
+ .comment-nav a, .comment-nav a:visited {
14
16
  color: black; }
15
- #comment-nav span {
16
- border: 1px solid #ffa;
17
- background-color: #ffd; }
18
- #comment-nav li.all a, #comment-nav li.all span {
17
+ .comment-nav span {
18
+ border: 1px solid #e8e8e8;
19
+ background-color: #eee; }
20
+ .all span, .all a {
19
21
  background-image: url(/images/admin/comments.png); }
20
- #comment-nav li.approved a, #comment-nav li.approved span {
22
+ .approved span, .approved a {
21
23
  background-image: url(/images/admin/accept.png); }
22
- #comment-nav li.unapproved a, #comment-nav li.unapproved span {
24
+ .unapproved span, .unapproved a {
23
25
  background-image: url(/images/admin/error.png); }
24
- #comment-nav li.csv a, #comment-nav li.csv span {
25
- background-image: url(/images/admin/table_save.png); }
26
26
 
27
- html>body li.all a, html>body li.all span, html>body li.approved a, html>body li.approved span, html>body li.unapproved a, html>body li.unapproved span, html>body li.csv a, html>body li.csv span {
28
- *display: inline-block; }
27
+ #content .outset {
28
+ margin-bottom: 40px;
29
+ }
29
30
 
30
- * html li.all a, * html li.all span, * html li.approved a, * html li.approved span, * html li.unapproved a, * html li.unapproved span, * html li.csv a, * html li.csv span {
31
- display: inline-block; }
32
-
33
- #content tr.comment td.content { color: #333; padding-right: 8px; width: 45%; font-size: 75%; }
34
- #content tr.comment blockquote.short { display: inline; margin: 0 }
35
- #content tr.comment blockquote.expanded { display:block; margin: 0; padding: 4px; border: 1px solid #bbc; background-color: #eef; }
36
- #content tr.comment td.controls, #content tr.comment td.date { white-space: nowrap }
37
- #content tr.comment.approved { background-color: #efe; }
38
- #content tr.comment a { color: black; }
39
- #content tr.comment a:visited { color: black; }
40
-
41
- button.delete-unapproved { padding: 5px; font-size: 120%; }
31
+ .controls-column, .date-column, .author-column { white-space: nowrap }
32
+ .comment-unapproved { background-color: #ffe; }
33
+ .comment a, .comment a:visited { color: black; }
@@ -1,133 +1,24 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
1
+ require File.expand_path("../lib/radiant-comments-extension/version", __FILE__)
5
2
 
6
3
  Gem::Specification.new do |s|
7
4
  s.name = %q{radiant-comments-extension}
8
- s.version = "0.0.6"
5
+ s.version = RadiantCommentsExtension::VERSION
6
+ s.platform = Gem::Platform::RUBY
9
7
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.required_rubygems_version = ">= 1.3.6"
11
9
  s.authors = ["Jim Gay", "Ryan Heneise", "Sean Cribbs", "John Muhl", "Sven Schwyn", "Gerrit Kaiser", "Stephen Lombardo", "Benny Degezelle", "Frank Louwers", "Michael Hale", "Nathaniel Talbott", "John Croisant", "Jon Leighton", "Witter Cheng", "Keith Bingman"]
12
- s.date = %q{2010-04-01}
10
+ s.date = %q{2010-10-11}
11
+ s.summary = %q{Comments Extension for Radiant CMS}
13
12
  s.description = %q{Adds blog-like comment functionality to Radiant.}
14
13
  s.email = %q{jim@saturnflyer.com}
15
14
  s.extra_rdoc_files = [
16
15
  "README.rdoc",
17
16
  "TODO"
18
17
  ]
19
- s.files = [
20
- ".gitignore",
21
- "CHANGELOG",
22
- "HELP_admin.markdown",
23
- "HELP_designer.markdown",
24
- "MIT-LICENSE",
25
- "README.rdoc",
26
- "Rakefile",
27
- "TODO",
28
- "VERSION",
29
- "app/controllers/admin/comments_controller.rb",
30
- "app/controllers/comments_controller.rb",
31
- "app/helpers/admin/comments_helper.rb",
32
- "app/models/akismet_spam_filter.rb",
33
- "app/models/comment.rb",
34
- "app/models/comment_mailer.rb",
35
- "app/models/mollom_spam_filter.rb",
36
- "app/models/simple_spam_filter.rb",
37
- "app/models/spam_filter.rb",
38
- "app/views/admin/comments/_comment.rhtml",
39
- "app/views/admin/comments/_form.rhtml",
40
- "app/views/admin/comments/edit.rhtml",
41
- "app/views/admin/comments/index.rhtml",
42
- "app/views/admin/pages/_comments.rhtml",
43
- "app/views/admin/pages/_edit_comments_enabled.rhtml",
44
- "app/views/admin/pages/_index_head_view_comments.rhtml",
45
- "app/views/admin/pages/_index_view_comments.rhtml",
46
- "app/views/comment_mailer/comment_notification.rhtml",
47
- "app/views/comments/_comment.rhtml",
48
- "app/views/comments/_form.rhtml",
49
- "app/views/comments/_new.rhtml",
50
- "autotest/discover.rb",
51
- "comments_extension.rb",
52
- "cucumber.yml",
53
- "db/migrate/001_create_comments.rb",
54
- "db/migrate/002_create_snippets.rb",
55
- "db/migrate/003_change_filter_id_from_integer_to_string.rb",
56
- "db/migrate/004_add_approval_columns.rb",
57
- "db/migrate/005_add_mollomid_column.rb",
58
- "db/migrate/006_move_config_to_migrations.rb",
59
- "db/migrate/007_add_preference_for_simple_spamcheck.rb",
60
- "features/support/env.rb",
61
- "features/support/paths.rb",
62
- "lib/akismet.rb",
63
- "lib/comment_page_extensions.rb",
64
- "lib/comment_tags.rb",
65
- "lib/mollom.rb",
66
- "lib/radiant-comments-extension.rb",
67
- "lib/tasks/comments_extension_tasks.rake",
68
- "public/images/admin/accept.png",
69
- "public/images/admin/comment_edit.png",
70
- "public/images/admin/comments.png",
71
- "public/images/admin/comments_delete.png",
72
- "public/images/admin/delete.png",
73
- "public/images/admin/email.png",
74
- "public/images/admin/error.png",
75
- "public/images/admin/link.png",
76
- "public/images/admin/page_white_edit.png",
77
- "public/images/admin/table_save.png",
78
- "public/images/admin/tick.png",
79
- "public/stylesheets/admin/comments.css",
80
- "radiant-comments-extension.gemspec",
81
- "spec/controllers/admin/comments_controller_spec.rb",
82
- "spec/controllers/admin/comments_routing_spec.rb",
83
- "spec/controllers/page_postback_spec.rb",
84
- "spec/datasets/comments_dataset.rb",
85
- "spec/models/akismet_spam_filter_spec.rb",
86
- "spec/models/comment_spec.rb",
87
- "spec/models/comment_tags_spec.rb",
88
- "spec/models/mollom_spam_filter_spec.rb",
89
- "spec/models/simple_spam_filter_spec.rb",
90
- "spec/models/spam_filter_spec.rb",
91
- "spec/spec.opts",
92
- "spec/spec_helper.rb",
93
- "test/fixtures/users.yml",
94
- "test/integration/comment_enabling_test.rb",
95
- "test/test_helper.rb",
96
- "test/unit/comment_test.rb"
97
- ]
18
+ s.files = `git ls-files`.split("\n")
98
19
  s.homepage = %q{http://github.com/saturnflyer/radiant-comments-extension}
99
20
  s.rdoc_options = ["--charset=UTF-8"]
100
21
  s.require_paths = ["lib"]
101
- s.rubygems_version = %q{1.3.6}
102
- s.summary = %q{Comments Extension for Radiant CMS}
103
- s.test_files = [
104
- "spec/controllers/admin/comments_controller_spec.rb",
105
- "spec/controllers/admin/comments_routing_spec.rb",
106
- "spec/controllers/page_postback_spec.rb",
107
- "spec/datasets/comments_dataset.rb",
108
- "spec/models/akismet_spam_filter_spec.rb",
109
- "spec/models/comment_spec.rb",
110
- "spec/models/comment_tags_spec.rb",
111
- "spec/models/mollom_spam_filter_spec.rb",
112
- "spec/models/simple_spam_filter_spec.rb",
113
- "spec/models/spam_filter_spec.rb",
114
- "spec/spec_helper.rb",
115
- "test/integration/comment_enabling_test.rb",
116
- "test/test_helper.rb",
117
- "test/unit/comment_test.rb"
118
- ]
119
-
120
- if s.respond_to? :specification_version then
121
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
122
- s.specification_version = 3
123
-
124
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
125
- s.add_development_dependency(%q<radiant>, [">= 0"])
126
- else
127
- s.add_dependency(%q<radiant>, [">= 0"])
128
- end
129
- else
130
- s.add_dependency(%q<radiant>, [">= 0"])
131
- end
22
+ s.test_files = `git ls-files spec test`.split("\n")
132
23
  end
133
24
 
@@ -4,7 +4,8 @@ describe SiteController, "Comments form posting to page" do
4
4
  dataset :pages
5
5
 
6
6
  before :each do
7
- Radiant::Config['comments.post_to_page?'] = true
7
+ Radiant::Config['comments.post_to_page?'] = 'true'
8
+ Radiant::Config['comments.auto_approve'] = 'true'
8
9
  end
9
10
 
10
11
  def do_post(comment_params={})
@@ -33,29 +33,18 @@ describe "Comment" do
33
33
  @comment.stub!(:using_logic_spam_filter?).and_return(false)
34
34
  Radiant::Config['comments.filters_enabled'] = "true"
35
35
  end
36
-
37
- it "should escape html for content_html when a filter is not selected" do
36
+
37
+ it "should remove script elements from the content" do
38
38
  @comment.content = %{<script type="text/javascript">alert('hello')</script>}
39
- @comment.save!
40
- @comment.content_html.should == %{<p>alert(&#39;hello&#39;)</p>}
41
- end
42
- it "should sanitize the content" do
43
- @comment.content = %{*hello* <script type="text/javascript">alert('hello')</script>}
44
39
  @comment.save!
45
- @comment.content_html.should_not include_text('script')
40
+ @comment.content_html.should_not =~ /script/
46
41
  end
47
- it "should filter the content for content_html when a filter is selected" do
42
+
43
+ it "should pass content for content_html through filter when one is selected" do
48
44
  @comment.filter_id = 'Textile'
49
- @comment.content = %{*hello* <script type="text/javascript">alert('hello')</script>}
45
+ @comment.content = %{*hello*}
50
46
  @comment.save!
51
- @comment.content_html.should match(/<strong>hello<\/strong>/)
52
- end
53
- it "should escape the content for content_html when a filter is not selected" do
54
- Radiant::Config['comments.filters_enabled'] = 'true'
55
- @comment.filter_id = ''
56
- @comment.content = %{*hello* <script type="text/javascript">alert('hello')</script>}
57
- @comment.save!
58
- @comment.content_html.should_not include_text('script')
47
+ @comment.content_html.should == '<p><strong>hello</strong></p>'
59
48
  end
60
49
 
61
50
  it "should successfully create comment" do
@@ -63,11 +52,6 @@ describe "Comment" do
63
52
  lambda{@comment.save!}.should_not raise_error
64
53
  end
65
54
 
66
- it "should set content_html with filter when saving" do
67
- @comment.save
68
- @comment.content_html.should eql("<p>That&#39;s all I have to say about that.</p>")
69
- end
70
-
71
55
  it "should validate that author is supplied" do
72
56
  comment = create_comment(:author => nil)
73
57
  comment.valid?.should be_false