Branston C0 Coverage Information - RCov

app/controllers/user_roles_controller.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
app/controllers/user_roles_controller.rb 105 62
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 UserRolesController < ApplicationController
16 
17   layout 'main'
18 
19   before_filter :login_required
20 
21   # GET /user_roles
22   # GET /user_roles.xml
23   def index
24     @user_roles = UserRole.all
25 
26     respond_to do |format|
27       format.html # index.html.erb
28       format.xml  { render :xml => @user_roles }
29     end
30   end
31 
32   # GET /user_roles/1
33   # GET /user_roles/1.xml
34   def show
35     @user_role = UserRole.find(params[:id])
36 
37     respond_to do |format|
38       format.html # show.html.erb
39       format.xml  { render :xml => @user_role }
40     end
41   end
42 
43   # GET /user_roles/new
44   # GET /user_roles/new.xml
45   def new
46     @user_role = UserRole.new
47 
48     respond_to do |format|
49       format.html # new.html.erb
50       format.xml  { render :xml => @user_role }
51     end
52   end
53 
54   # GET /user_roles/1/edit
55   def edit
56     @user_role = UserRole.find(params[:id])
57   end
58 
59   # POST /user_roles
60   # POST /user_roles.xml
61   def create
62     @user_role = UserRole.new(params[:user_role])
63 
64     respond_to do |format|
65       if @user_role.save
66         flash[:notice] = 'UserRole was successfully created.'
67         format.html { redirect_to(@user_role) }
68         format.xml  { render :xml => @user_role, :status => :created, :location => @user_role }
69       else
70         format.html { render :action => "new" }
71         format.xml  { render :xml => @user_role.errors, :status => :unprocessable_entity }
72       end
73     end
74   end
75 
76   # PUT /user_roles/1
77   # PUT /user_roles/1.xml
78   def update
79     @user_role = UserRole.find(params[:id])
80 
81     respond_to do |format|
82       if @user_role.update_attributes(params[:user_role])
83         flash[:notice] = 'UserRole was successfully updated.'
84         format.html { redirect_to(@user_role) }
85         format.xml  { head :ok }
86       else
87         format.html { render :action => "edit" }
88         format.xml  { render :xml => @user_role.errors, :status => :unprocessable_entity }
89       end
90     end
91   end
92 
93   # DELETE /user_roles/1
94   # DELETE /user_roles/1.xml
95   def destroy
96     @user_role = UserRole.find(params[:id])
97     @user_role.destroy
98 
99     respond_to do |format|
100       format.html { redirect_to(user_roles_url) }
101       format.xml  { head :ok }
102     end
103   end
104 end
105 

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