Commit 4a6afb41c4f9ba3fe87680b22a369764b2f1e1b7
1 parent
87f4d048
Exists in
master
and in
29 other branches
ActionItem79: creating a helper for the current language
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@600 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
34 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,24 @@ |
1 | +require File.dirname(__FILE__) + '/../test_helper' | |
2 | + | |
3 | +class LanguageHelperTest < Test::Unit::TestCase | |
4 | + | |
5 | + include LanguageHelper | |
6 | + | |
7 | + def test_english | |
8 | + locale = mock | |
9 | + locale.expects(:to_s).returns('en_us') | |
10 | + GetText.stubs(:locale).returns(locale) | |
11 | + | |
12 | + assert_equal 'en', self.language | |
13 | + end | |
14 | + | |
15 | + def test_other_languages | |
16 | + locale = mock | |
17 | + locale.expects(:to_s).returns('pt_BR') | |
18 | + GetText.stubs(:locale).returns(locale) | |
19 | + | |
20 | + assert_equal 'pt_br', self.language | |
21 | + end | |
22 | + | |
23 | +end | |
24 | + | ... | ... |