Commit 88f677d118a841b7ba1247309ecdd6bfcb8ff0fb
1 parent
438bff7e
Exists in
master
and in
29 other branches
ActionItem166: adding help to format date and time
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1523 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
22 additions
and
0 deletions
Show diff stats
app/helpers/application_helper.rb
test/unit/application_helper_test.rb
| ... | ... | @@ -28,6 +28,20 @@ class ApplicationHelperTest < Test::Unit::TestCase |
| 28 | 28 | assert_equal '', stylesheet_import('something') |
| 29 | 29 | end |
| 30 | 30 | |
| 31 | + should 'translate date' do | |
| 32 | + date = mock | |
| 33 | + expects(:_).with('%d %B %Y').returns('the date') | |
| 34 | + date.expects(:strftime).with('the date').returns('translated date') | |
| 35 | + assert_equal 'translated date', show_date(date) | |
| 36 | + end | |
| 37 | + | |
| 38 | + should 'translate time' do | |
| 39 | + time = mock | |
| 40 | + expects(:_).with('%d %B %Y, %H:%m').returns('the time') | |
| 41 | + time.expects(:strftime).with('the time').returns('translated time') | |
| 42 | + assert_equal 'translated time', show_time(time) | |
| 43 | + end | |
| 44 | + | |
| 31 | 45 | protected |
| 32 | 46 | |
| 33 | 47 | def content_tag(tag, content, options) | ... | ... |