C0 code coverage information
Generated on Tue May 30 23:34:43 CEST 2006 with rcov 0.5.0
Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
1 require_dependency 'transforms'
2
3 class Comment < ActiveRecord::Base
4 belongs_to :article
5
6 validates_presence_of :author, :body
7 validates_against_spamdb :body, :url, :ip
8 validates_age_of :article_id
9
10 protected
11
12 before_save :correct_url, :make_nofollow, :transform_body, :make_nofollow
13
14 def correct_url
15 unless url.to_s.empty?
16 unless url =~ /^http\:\/\//
17 self.url = "http://#{url}"
18 end
19 end
20 end
21
22 def make_nofollow
23 self.author = nofollowify(author)
24 self.body = nofollowify(body)
25 end
26
27 def transform_body
28 # Escape HTML in comments
29 self.body_html = HtmlEngine.transform(body, config["comment_text_filter"], [:filter_html])
30 end
31
32 end
Generated using the rcov code coverage analysis tool for Ruby version 0.5.0.