Commit bcd6ba1814b7a077884abcf253042233fdbbdc3e
Committed by
Daniel
1 parent
c0263c49
Exists in
colab
and in
2 other branches
Add FUNCTION scope to compound_metric_configuration form
Signed-off-by: Daniel Miranda <danielkza2@gmail.com>
Showing
4 changed files
with
8 additions
and
2 deletions
Show diff stats
app/helpers/compound_metric_configurations_helper.rb
1 | 1 | module CompoundMetricConfigurationsHelper |
2 | 2 | def scope_options |
3 | - [[t("scopes.METHOD"),"METHOD"], [t("scopes.CLASS"), "CLASS"], [t("scopes.PACKAGE"), "PACKAGE"], [t("scopes.SOFTWARE"), "SOFTWARE"]] | |
3 | + %w(FUNCTION METHOD CLASS PACKAGE SOFTWARE).map do |scope| | |
4 | + [t("scopes.#{scope}"), scope] | |
5 | + end | |
4 | 6 | end |
5 | 7 | |
6 | 8 | def compound_metric_human_name(count=1) | ... | ... |
config/locales/views/metric_configurations/en.yml
config/locales/views/metric_configurations/pt.yml
spec/helpers/compound_metric_configurations_helper_spec.rb
... | ... | @@ -3,7 +3,9 @@ require 'rails_helper' |
3 | 3 | describe CompoundMetricConfigurationsHelper, :type => :helper do |
4 | 4 | describe 'scope_options' do |
5 | 5 | it 'should return an array with the supported scope options' do |
6 | - expect(helper.scope_options).to eq [["Method","METHOD"], ["Class", "CLASS"], ["Package", "PACKAGE"], ["Software", "SOFTWARE"]] | |
6 | + expect(helper.scope_options).to eq [ | |
7 | + ["Function", "FUNCTION"], ["Method","METHOD"], ["Class", "CLASS"], ["Package", "PACKAGE"], ["Software", "SOFTWARE"] | |
8 | + ] | |
7 | 9 | end |
8 | 10 | end |
9 | 11 | ... | ... |