Commit 19a9adefba046f0c3bb36f739279ab875845833d

Authored by Rafael Manzo
2 parents 8154c91e cef5c887

Merge pull request #194 from MezuroUNB20151/issue_142

Added count option to the aggregation form on metrics configuration creation
app/helpers/metric_configurations_helper.rb
1 1 module MetricConfigurationsHelper
2 2 def aggregation_options
3 3 [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"],
4   - ["Standard Deviation", "STANDARD_DEVIATION"]]
  4 + ["Standard Deviation", "STANDARD_DEVIATION"], ["Count", "COUNT"]]
5 5 end
6 6  
7 7 def reading_group_options
... ...
features/metric_configuration/create.feature
... ... @@ -71,3 +71,20 @@ Feature: Metric Configuration Creation
71 71 And I set the select field "Reading Group" as "Scholar"
72 72 When I press the Save button
73 73 Then I should see "Code must be unique within a kalibro configuration"
  74 +
  75 + @kalibro_configuration_restart @javascript
  76 + Scenario: metric configuration creation with count aggregation form
  77 + Given I am a regular user
  78 + And I am signed in
  79 + And I own a sample configuration
  80 + And I have a reading group named "Scholar"
  81 + And I am at the Sample Configuration page
  82 + And I click the Add Metric link
  83 + And I click the "Analizo" h3
  84 + And I click the Lines of Code link
  85 + And I fill the Weight field with "100"
  86 + And I set the select field "Aggregation Form" as "Count"
  87 + And I set the select field "Reading Group" as "Scholar"
  88 + When I press the Save button
  89 + Then I should see "Lines of Code"
  90 + Then I should see "100"
... ...
spec/helpers/metric_configurations_helper_spec.rb
... ... @@ -4,7 +4,7 @@ describe MetricConfigurationsHelper, :type => :helper do
4 4 describe 'aggregation_form_options' do
5 5 it 'should return an array with the supported aggregation forms' do
6 6 expect(helper.aggregation_options).to eq [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"],
7   - ["Standard Deviation", "STANDARD_DEVIATION"]]
  7 + ["Standard Deviation", "STANDARD_DEVIATION"], ["Count", "COUNT"]]
8 8 end
9 9 end
10 10  
... ...