Commit f9116a97e8555114d5bab5972a03903ea927f6f4
Committed by
Caio
1 parent
3cdc22b2
Exists in
master
and in
29 other branches
[Mezuro] Completed helper tests
Showing
3 changed files
with
11 additions
and
4 deletions
Show diff stats
plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
plugins/mezuro/test/unit/mezuro_plugin/helpers/content_viewer_helper_test.rb
0 → 100644
... | ... | @@ -0,0 +1,10 @@ |
1 | +require "test_helper" | |
2 | + | |
3 | +class ContentViewerHelperTest < ActiveSupport::TestCase | |
4 | + | |
5 | + should 'get the number rounded by two decimal points' do | |
6 | + assert_equal '4.22', MezuroPlugin::Helpers::ContentViewerHelper.format_grade('4.22344') | |
7 | + assert_equal '4.10', MezuroPlugin::Helpers::ContentViewerHelper.format_grade('4.1') | |
8 | + assert_equal '4.00', MezuroPlugin::Helpers::ContentViewerHelper.format_grade('4') | |
9 | + end | |
10 | +end | ... | ... |
plugins/mezuro/views/content_viewer/_module_result.rhtml
1 | -<% require "#{RAILS_ROOT}/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb" %> | |
2 | - | |
3 | 1 | <% the_module = module_result.module %> |
4 | 2 | <% module_label = "#{the_module.name} (#{the_module.granularity})" %> |
5 | 3 | |
... | ... | @@ -47,4 +45,3 @@ |
47 | 45 | </tr> |
48 | 46 | </tfoot> |
49 | 47 | </table> |
50 | - | ... | ... |