| Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
|---|---|---|---|---|
| app/controllers/users_controller.rb | 37 | 26 | 86.49%
|
80.77%
|
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 UsersController < ApplicationController |
2 |
3 before_filter :authorize_only_for_admin |
4 |
5 # Controller corresponding to the users management part |
6 |
7 # Displays sections, and allows to create them |
8 #TODO Displays metrics concerning users and sections |
9 def index |
10 @sections = Section.find(:all) |
11 end |
12 |
13 # Creates a new section |
14 def create_section |
15 return unless request.post? |
16 @section = Section.new(params[:section]) |
17 if @section.save |
18 flash[:success] = I18n.t('section.create.success') |
19 redirect_to :action => 'index' |
20 else |
21 flash[:error] = I18n.t('section.create.error') |
22 end |
23 end |
24 |
25 # edit a section |
26 # TODO test |
27 def edit_section |
28 @section = Section.find_by_id(params[:id]) |
29 return unless request.post? |
30 if @section.update_attributes(params[:section]) |
31 flash[:success] = I18n.t('section.update.success') |
32 redirect_to :action => 'index' |
33 else |
34 flash[:error] = I18n.t('section.update.error') |
35 end |
36 end |
37 end |
Generated on Sun Feb 05 00:08:07 -0500 2012 with rcov 0.9.10