[Git][noosfero/noosfero][master] profile followers: Fixes failing test

Larissa Reis gitlab at mg.gitlab.com
Mon Jul 18 17:43:13 BRT 2016


Larissa Reis pushed to branch master at Noosfero / noosfero


Commits:
bde4a4f8 by Larissa Reis at 2016-07-18T17:40:59-03:00
profile followers: Fixes failing test

We now remove profile_follewers if its circle is deleted

- - - - -


1 changed file:

- test/functional/circles_controller_test.rb


Changes:

=====================================
test/functional/circles_controller_test.rb
=====================================
--- a/test/functional/circles_controller_test.rb
+++ b/test/functional/circles_controller_test.rb
@@ -74,17 +74,13 @@ class CirclesControllerTest < ActionController::TestCase
     assert_response 404
   end
 
-  should 'destroy an existing circle and update related profiles' do
+  should 'destroy an existing circle and remove related profiles' do
     circle = Circle.create!(:name => "circle", :person => @person, :profile_type => 'Person')
-    follower = fast_create(ProfileFollower, :profile_id => fast_create(Person).id,
-                           :circle_id => circle.id)
+    fast_create(ProfileFollower, :profile_id => fast_create(Person).id, :circle_id => circle.id)
 
-    assert_difference "@person.circles.count", -1 do
+    assert_difference ["@person.circles.count", 'ProfileFollower.count'], -1 do
       post :destroy, :profile => @person.identifier, :id => circle.id
     end
-
-    follower.reload
-    assert_nil follower.circle
   end
 
   should 'not destroy an existing circle if action is not post' do



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/bde4a4f817aa26f57e6c6d21e7b67339a33f7996
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160718/617c6ac1/attachment-0001.html>


More information about the Noosfero-dev mailing list