Commit cef5c8870a8c7d7e6168046f1e80428eb3c87fca
1 parent
f026abd8
Exists in
colab
and in
4 other branches
Added Count option to the Aggregation form on metric configuration creation
Signed-off-by: Álvaro Fernando <alvarofernandoms@hotmail.com> Signed-off-by: Eduardo Brasil <brasil.eduardo1@gmail.com>
Showing
3 changed files
with
19 additions
and
2 deletions
Show diff stats
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
| ... | ... | @@ -54,3 +54,20 @@ Feature: Metric Configuration Creation |
| 54 | 54 | And I set the select field "Reading Group" as "Scholar" |
| 55 | 55 | When I press the Save button |
| 56 | 56 | Then I should see "Code must be unique within a kalibro configuration" |
| 57 | + | |
| 58 | + @kalibro_configuration_restart @javascript | |
| 59 | + Scenario: metric configuration creation with count aggregation form | |
| 60 | + Given I am a regular user | |
| 61 | + And I am signed in | |
| 62 | + And I own a sample configuration | |
| 63 | + And I have a reading group named "Scholar" | |
| 64 | + And I am at the Sample Configuration page | |
| 65 | + And I click the Add Metric link | |
| 66 | + And I click the "Analizo" h3 | |
| 67 | + And I click the Lines of Code link | |
| 68 | + And I fill the Weight field with "100" | |
| 69 | + And I set the select field "Aggregation Form" as "Count" | |
| 70 | + And I set the select field "Reading Group" as "Scholar" | |
| 71 | + When I press the Save button | |
| 72 | + Then I should see "Lines of Code" | |
| 73 | + 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 | ... | ... |