C0 code coverage information
Generated on Fri Feb 20 01:17:01 -0800 2009 with
rcov 0.8.1.2
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.
1
class CommentsController < ApplicationController 2 3 before_filter :get_idea 4 5 # POST /comments 6 # POST /comments.xml 7 def create 8 @comment = Comment.new(params[:comment]) 9 @comment.idea = @idea 10 11 respond_to do |format| 12 if @comment.save 13 flash[:notice] = 'Comment was successfully created.'
14 format.html {
redirect_to( idea_path(@idea) ) } 15 format.xml { render :xml => @comment, :status =>
:created, :location => @comment } 16 else 17 session[:new_comment] = @comment 18 format.html { redirect_to(
idea_path(@idea, :anchor => 'new_comment') ) } 19 format.xml { render :xml =>
@comment.errors, :status => :unprocessable_entity } 20 end 21 end 22 end 23 24 # DELETE /comments/1 25 # DELETE /comments/1.xml 26 def destroy 27 @comment = Comment.find(params[:id])
28 @comment.destroy
29 30 respond_to do |format| 31 format.html { redirect_to(
idea_path(@idea) ) } 32
format.xml { head :ok } 33 end 34 end 35 36
protected 37
38 def get_idea
39 @idea =
Idea.find(params[:idea_id]) 40 end 41 42
end
Generated using the rcov
code coverage analysis tool for Ruby version 0.8.1.2.