Commit d9aa9757cea8a65549fd96972241897fe4ff7c49
1 parent
24df54b1
Exists in
master
and in
22 other branches
Fix test
Tests must not depend on compiled translations.
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
test/unit/noosfero_test.rb
@@ -57,13 +57,14 @@ class NoosferoTest < Test::Unit::TestCase | @@ -57,13 +57,14 @@ class NoosferoTest < Test::Unit::TestCase | ||
57 | end | 57 | end |
58 | 58 | ||
59 | should 'use terminology with ngettext' do | 59 | should 'use terminology with ngettext' do |
60 | - Noosfero.terminology = UnifreireTerminology.instance | 60 | + Noosfero.stubs(:terminology).returns(UnifreireTerminology.instance) |
61 | 61 | ||
62 | Noosfero.with_locale('en') do | 62 | Noosfero.with_locale('en') do |
63 | assert_equal 'One institution', n__('One enterprise', '%{num} enterprises', 1) | 63 | assert_equal 'One institution', n__('One enterprise', '%{num} enterprises', 1) |
64 | end | 64 | end |
65 | 65 | ||
66 | Noosfero.with_locale('pt') do | 66 | Noosfero.with_locale('pt') do |
67 | + stubs(:ngettext).with('One institution', '%{num} institutions', 1).returns('Uma instituição') | ||
67 | assert_equal 'Uma instituição', n__('One enterprise', '%{num} enterprises', 1) | 68 | assert_equal 'Uma instituição', n__('One enterprise', '%{num} enterprises', 1) |
68 | end | 69 | end |
69 | end | 70 | end |