Branston C0 Coverage Information - RCov

app/controllers/releases_controller.rb

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

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