C0 code coverage information

Generated on Mon Dec 08 16:53:36 -0800 2008 with rcov 0.8.1.3


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.
Name Total lines Lines of code Total coverage Code coverage
app/models/user.rb 54 30
100.0%  
100.0%  
 1 require 'digest/sha1'
 2 
 3 class User < ActiveRecord::Base
 4   include Authentication
 5   include Authentication::ByPassword
 6   include Authentication::ByCookieToken
 7   
 8   #has_one :doctor, :dependent => :destroy
 9   
10   validates_presence_of     :login
11   validates_length_of       :login,    :within => 3..40
12   validates_uniqueness_of   :login
13   validates_format_of       :login,    :with => Authentication.login_regex, :message => Authentication.bad_login_message
14 
15   validates_format_of       :name,     :with => Authentication.name_regex,  :message => Authentication.bad_name_message, :allow_nil => true
16   validates_length_of       :name,     :maximum => 100
17 
18   validates_presence_of     :email
19   validates_length_of       :email,    :within => 6..100 #r@a.wk
20   validates_uniqueness_of   :email
21   validates_format_of       :email,    :with => Authentication.email_regex, :message => Authentication.bad_email_message
22 
23   validates_presence_of     :user_type
24 
25   # HACK HACK HACK -- how to do attr_accessible from here?
26   # prevents a user from submitting a crafted form that bypasses activation
27   # anything else you want your user to change should be added here.
28   attr_accessible :login, :email, :name, :password, :password_confirmation, :user_type
29 
30   # Authenticates a user by their login name and unencrypted password.  Returns the user or nil.
31   #
32   # uff.  this is really an authorization, not authentication routine.  
33   # We really need a Dispatch Chain here or something.
34   # This will also let us return a human error message.
35   #
36   def self.authenticate(login, password)
37     return nil if login.blank? || password.blank?
38     u = find_by_login(login) # need to get the salt
39     u && u.authenticated?(password) ? u : nil
40   end
41 
42   def login=(value)
43     write_attribute :login, (value ? value.downcase : nil)
44   end
45 
46   def email=(value)
47     write_attribute :email, (value ? value.downcase : nil)
48   end
49 
50   protected
51     
52 
53 
54 end

Generated using the rcov code coverage analysis tool for Ruby version 0.8.1.3.

Valid XHTML 1.0! Valid CSS!