Commit 55d082a413bd208d4c2d5bae80e703d4614e5bd3

Authored by Heitor
Committed by Rafael Manzo
1 parent 2443cd3a

Fixed metric configuration acceptance tests

Signed off by: Diego Araújo <diegoamc90@gmail.com>
app/controllers/metric_configurations_controller.rb
... ... @@ -65,7 +65,7 @@ class MetricConfigurationsController &lt; BaseMetricConfigurationsController
65 65 @kalibro_configuration_id = params[:kalibro_configuration_id]
66 66  
67 67 format.html { render action: destiny_action }
68   - format.json { render json: @metric_configuration.errors, status: :unprocessable_entity }
  68 + format.json { render json: @metric_configuration.kalibro_errors, status: :unprocessable_entity }
69 69 end
70 70  
71 71 #Code extracted from create action
... ...
app/views/metric_configurations/edit.html.erb
... ... @@ -6,6 +6,6 @@
6 6 <%= render partial: 'form', locals: {f: f} %>
7 7 <div class="row margin-left-none" style="margin-top: 20px">
8 8 <%= f.submit 'Save', class: 'btn btn-primary' %>
9   - <%= link_to 'Back', kalibro_configuration_path(@metric_configuration.configuration_id), class: 'btn btn-default' %>
  9 + <%= link_to 'Back', kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %>
10 10 </div>
11 11 <% end %>
... ...
features/metric_configuration/edition.feature
... ... @@ -13,7 +13,7 @@ Feature: Metric Configuration edition
13 13 When I am at the Sample Configuration page
14 14 Then I should not see Edit within table
15 15  
16   - @kalibro_configuration_restart
  16 + @kalibro_configuration_restart @javascript
17 17 Scenario: editing a metric configuration successfully
18 18 Given I am a regular user
19 19 And I am signed in
... ... @@ -22,6 +22,7 @@ Feature: Metric Configuration edition
22 22 And I have a sample metric configuration within the given mezuro configuration
23 23 And I am at the Sample Configuration page
24 24 When I click the Edit link
  25 + And I take a picture of the page
25 26 And I fill the Weight field with "3.0"
26 27 And I press the Save button
27 28 Then I should see "3.0"
... ... @@ -36,7 +37,7 @@ Feature: Metric Configuration edition
36 37 When I visit the sample metric configuration edit page
37 38 And I fill the Weight field with " "
38 39 And I press the Save button
39   - Then I should see "Weight can't be blank"
  40 + Then I should see "Weight must be greater than 0"
40 41  
41 42 @kalibro_configuration_restart
42 43 Scenario: Should not edit a metric configuration with invalid weight
... ...