Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,28 @@ | ||
require 'test_helper' | ||
|
||
class MeasurementsHelperTest < ActionView::TestCase | ||
module MeasurementsHelperTest | ||
|
||
class DateTimeColumnHeader < ActionView::TestCase | ||
|
||
include MeasurementsHelper | ||
|
||
test 'should return expected text when @measurements is empty' do | ||
@measurements = [] | ||
assert_equal 'Date/Time', date_time_column_header | ||
end | ||
|
||
test 'should return expected text when @measurements contains no approximate times' do | ||
@measurements = [stub(:approximate_time? => false)] | ||
assert_equal 'Date/Time', date_time_column_header | ||
end | ||
|
||
test 'should return expected text when @measurements contains both an approximate time and an exact time' do | ||
@measurements = [stub(:approximate_time? => true), | ||
stub(:approximate_time? => false)] | ||
assert_equal '<span class="approximate">(≈ Approximate) </span>Date/Time', | ||
date_time_column_header | ||
end | ||
|
||
end | ||
|
||
end |