Commit 810b3e3038246e15b054e3a50f82ddc11d3ec355

Authored by Fellipe Souto Sampaio
Committed by Rafael Manzo
1 parent 5625d942

Edit feature for Reading

Signed-of By: João M. M. Silva <jaodsilv@linux.ime.usp.br>
app/controllers/readings_controller.rb
... ... @@ -29,7 +29,7 @@ class ReadingsController &lt; ApplicationController
29 29 @reading.group_id = params[:reading_group_id].to_i
30 30 respond_to do |format|
31 31 if @reading.update(reading_params)
32   - format.html { redirect_to(reading_group_reading_path(params[:reading_group_id].to_i, @reading.id), notice: 'Reading was successfully updated.') }
  32 + format.html { redirect_to(reading_group_path(params[:reading_group_id].to_i), notice: 'Reading was successfully updated.') }
33 33 format.json { head :no_content }
34 34 else
35 35 failed_action(format, 'edit')
... ...
features/reading/edit.feature
... ... @@ -3,7 +3,7 @@ Feature: Reading Edit
3 3 As a regular user
4 4 I should be able to edit my readings
5 5  
6   -@kalibro_restart @wip
  6 +@kalibro_restart
7 7 Scenario: editing a reading successfully
8 8 Given I am a regular user
9 9 And I am signed in
... ... @@ -16,9 +16,7 @@ Feature: Reading Edit
16 16 When I fill the Label field with "Bad"
17 17 And I press the Save button
18 18 Then I should see "Bad"
19   - And I should see "10.5"
20   - And I should see "33dd33"
21   -
  19 +
22 20 @kalibro_restart
23 21 Scenario: editing a reading with blank fields
24 22 Given I am a regular user
... ...