Branston C0 Coverage Information - RCov

app/controllers/iterations_controller.rb

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

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