Branston C0 Coverage Information - RCov

app/controllers/users_controller.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
app/controllers/users_controller.rb 42 19
100.00%
100.00%

Key

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.

Coverage Details

1 #    This file is part of Branston.
2 #
3 #    Branston is free software: you can redistribute it and/or modify
4 #    it under the terms of the GNU Affero General Public License as published by
5 #    the Free Software Foundation.
6 #
7 #    Branston is distributed in the hope that it will be useful,
8 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
9 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 #    GNU Affero General Public License for more details.
11 #
12 #    You should have received a copy of the GNU Affero General Public License
13 #    along with Branston.  If not, see <http://www.gnu.org/licenses/>.
14 
15 class UsersController < ApplicationController
16 
17   layout 'main'
18 
19   # render new.rhtml
20   def new
21     @user = User.new
22   end
23 
24   def create
25     logout_keeping_session!
26     @user = User.new(params[:user])
27     success = @user && @user.save
28     if success && @user.errors.empty?
29       # Protects against session fixation attacks, causes request forgery
30       # protection if visitor resubmits an earlier form using back
31       # button. Uncomment if you understand the tradeoffs.
32       # reset session
33       self.current_user = @user # !! now logged in
34       redirect_back_or_default('/')
35       flash[:notice] = "Thanks for signing up!  We're sending you an email with your activation code."
36     else
37       flash[:error]  = "We couldn't set up that account, sorry.  Please try again, or contact an admin (link is above)."
38       render :action => 'new'
39     end
40   end
41 end
42 

Generated on Thu Jan 07 15:27:03 +0000 2010 with rcov 0.9.6