[Git][noosfero/noosfero][master] 2 commits: Revert "remove unit test causing colateral errors"

Joenio Costa gitlab at mg.gitlab.com
Wed Mar 16 16:28:36 BRT 2016


Joenio Costa pushed to branch master at Noosfero / noosfero


Commits:
1af11191 by Joenio Costa at 2016-03-16T13:18:29-03:00
Revert "remove unit test causing colateral errors"

This reverts commit 23bd8bbc2293d5123bbcb4b416143934edf23abc.

I found a way to fix the problem using `alias_method`

- - - - -
99f5d74c by Joenio Costa at 2016-03-16T13:56:13-03:00
restore ApplicationHelper.profile_image_link after test execution

this avoid colateral errors in others tests

refers to commit: 1af11191ddb2da6ea93ea86ce7fbbb9a089feaf7

- - - - -


1 changed file:

- test/unit/profile_list_block_test.rb


Changes:

=====================================
test/unit/profile_list_block_test.rb
=====================================
--- a/test/unit/profile_list_block_test.rb
+++ b/test/unit/profile_list_block_test.rb
@@ -22,6 +22,32 @@ class ProfileListBlockTest < ActiveSupport::TestCase
 
   include BoxesHelper
 
+  should 'list people' do
+    env = fast_create(Environment)
+
+    person1 = create_user('testperson1', :environment => env).person
+    person2 = create_user('testperson2', :environment => env).person
+    person3 = create_user('testperson3', :environment => env).person
+
+    block = ProfileListBlock.new
+    block.stubs(:owner).returns(env)
+
+    ApplicationHelper.class_eval do
+      alias_method :original_profile_image_link, :profile_image_link
+      def profile_image_link( profile, size=:portrait, tag='li', extra_info = nil )
+        "<#{profile.name}>"
+      end
+    end
+
+    content = render_block_content(block)
+    assert_match '<testperson1>', content
+    assert_match '<testperson2>', content
+    assert_match '<testperson3>', content
+    ApplicationHelper.class_eval do
+      alias_method :profile_image_link, :original_profile_image_link
+    end
+  end
+
   should 'list private profiles' do
     env = fast_create(Environment)
     env.boxes << Box.new



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/43b317df358d3e2d1960e6a453726fe81a6cd0a8...99f5d74cc1ae8aab54d53d9c58ec2475959e6e5e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160316/cef8a3ec/attachment-0001.html>


More information about the Noosfero-dev mailing list