[Git][noosfero/noosfero][master] avoid random failure in locale test

Leandro Nunes gitlab at mg.gitlab.com
Mon Jul 4 19:47:29 BRT 2016


Leandro Nunes pushed to branch master at Noosfero / noosfero


Commits:
8b7097ab by Leandro Nunes dos Santos at 2016-07-04T18:49:13-03:00
avoid random failure in locale test

- - - - -


1 changed file:

- test/unit/noosfero_test.rb


Changes:

=====================================
test/unit/noosfero_test.rb
=====================================
--- a/test/unit/noosfero_test.rb
+++ b/test/unit/noosfero_test.rb
@@ -43,10 +43,11 @@ class NoosferoTest < ActiveSupport::TestCase
   end
 
   should 'change locale temporarily' do
-    Noosfero.with_locale('pt') do
+    current_locale = FastGettext.locale
+    Noosfero.with_locale(current_locale == 'pt' ? 'en' : 'pt' ) do
       assert_equal 'pt', FastGettext.locale
     end
-    assert_equal 'en', FastGettext.locale
+    assert_equal current_locale, FastGettext.locale
   end
 
   should "use default hostname of default environment as hostname of Noosfero instance" do



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/8b7097abd2a8e4a10aaf64ffe663d776cb25dbbf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160704/7dbe3745/attachment-0001.html>


More information about the Noosfero-dev mailing list