### C0 code coverage information

Generated on Sun Aug 31 02:38:34 -0400 2008 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.

Name | Total lines | Lines of code | Total coverage | Code coverage
app/controllers/photos_controller.rb | `89` | `64` |
`100.0%` |
`100.0%` |

     1 class PhotosController < ApplicationController
     2   # GET /photos
     3   # GET /photos.xml
     4   def index
     5     @photos = Photo.find(:all)
     6
     7     respond_to do |format|
     8       format.html # index.html.erb
     9       format.xml  { render :xml => @photos }
    10     end
    11   end
    12
    13   # GET /photos/1
    14   # GET /photos/1.xml
    15   def show
    16     @photo = Photo.find(params[:id])
    17
    18     respond_to do |format|
    19       format.html # show.html.erb
    20       format.xml  { render :xml => @photo }
    21     end
    22   end
    23
    24   # GET /photos/new
    25   # GET /photos/new.xml
    26   def new
    27     @photo = Photo.new
    28     @all_categories = Category.find(:all, :order => "name")
    29
    30     respond_to do |format|
    31       format.html # new.html.erb
    32       format.xml  { render :xml => @photo }
    33     end
    34   end
    35
    36   # GET /photos/1/edit
    37   def edit
    38     @photo = Photo.find(params[:id])
    39     @all_categories = Category.find(:all, :order => "name")
    40   end
    41
    42   # POST /photos
    43   # POST /photos.xml
    44   def create
    45     @photo = Photo.new(params[:photo])
    46
    47     respond_to do |format|
    48       if @photo.save
    49         flash[:notice] = 'Photo was successfully created.'
    50         format.html { redirect_to(@photo) }
    51         format.xml  { render :xml => @photo, :status => :created, :location => @photo }
    52       else
    53         @all_categories = Category.find(:all, :order => "name")
    54         format.html { render :action => "new" }
    55         format.xml  { render :xml => @photo.errors, :status => :unprocessable_entity }
    56       end
    57     end
    58   end
    59
    60   # PUT /photos/1
    61   # PUT /photos/1.xml
    62   def update
    63     @photo = Photo.find(params[:id])
    64
    65     respond_to do |format|
    66       if @photo.update_attributes(params[:photo])
    67         flash[:notice] = 'Photo was successfully updated.'
    68         format.html { redirect_to(@photo) }
    69         format.xml  { head :ok }
    70       else
    71         @all_categories = Category.find(:all, :order => "name")
    72         format.html { render :action => "edit" }
    73         format.xml  { render :xml => @photo.errors, :status => :unprocessable_entity }
    74       end
    75     end
    76   end
    77
    78   # DELETE /photos/1
    79   # DELETE /photos/1.xml
    80   def destroy
    81     @photo = Photo.find(params[:id])
    82     @photo.destroy
    83
    84     respond_to do |format|
    85       format.html { redirect_to(photos_url) }
    86       format.xml  { head :ok }
    87     end
    88   end
    89 end

Generated using the rcov code coverage analysis tool for Ruby version 0.8.1.2.