[Git][noosfero/noosfero][master] 2 commits: fix unit test logic

Leandro Nunes gitlab at mg.gitlab.com
Tue Jul 5 14:06:26 BRT 2016


Leandro Nunes pushed to branch master at Noosfero / noosfero


Commits:
829a7963 by Leandro Nunes dos Santos at 2016-07-05T14:02:26-03:00
fix unit test logic

- - - - -
4615d072 by Leandro Nunes dos Santos at 2016-07-05T14:03:05-03:00
should trust in task html code

- - - - -


2 changed files:

- app/models/add_member.rb
- test/unit/noosfero_test.rb


Changes:

=====================================
app/models/add_member.rb
=====================================
--- a/app/models/add_member.rb
+++ b/app/models/add_member.rb
@@ -56,7 +56,7 @@ class AddMember < Task
   def target_notification_description
     requestor_email = " (#{requestor.email})" if requestor.may_display_field_to?("email")
 
-    _("%{requestor}%{requestor_email} wants to be a member of '%{organization}'.") % {:requestor => requestor.name, :requestor_email => requestor_email, :organization => organization.name}
+    _("%{requestor}%{requestor_email} wants to be a member of '%{organization}'.").html_safe % {:requestor => requestor.name, :requestor_email => requestor_email, :organization => organization.name}
   end
 
   def target_notification_message


=====================================
test/unit/noosfero_test.rb
=====================================
--- a/test/unit/noosfero_test.rb
+++ b/test/unit/noosfero_test.rb
@@ -44,8 +44,9 @@ class NoosferoTest < ActiveSupport::TestCase
 
   should 'change locale temporarily' do
     current_locale = FastGettext.locale
-    Noosfero.with_locale(current_locale == 'pt' ? 'en' : 'pt' ) do
-      assert_equal 'pt', FastGettext.locale
+    another_locale = current_locale == 'pt' ? 'en' : 'pt'
+    Noosfero.with_locale(another_locale) do
+      assert_equal another_locale, FastGettext.locale
     end
     assert_equal current_locale, FastGettext.locale
   end



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/f5e7969587a05bf06b4a4d8e12df698d6283e57a...4615d072b38087c0836d13128073a1840b9c204d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160705/13cfbecf/attachment-0001.html>


More information about the Noosfero-dev mailing list