diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index 7178623..964a281 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -78,7 +78,7 @@ class ProfileControllerTest < ActionController::TestCase should 'actually add friend' do login_as(@profile.identifier) - person = fast_create(Person) + person = create_user.person assert_difference 'AddFriend.count' do post :add, :profile => person.identifier end @@ -366,10 +366,10 @@ class ProfileControllerTest < ActionController::TestCase assert profile.memberships.include?(community), 'profile should be actually added to the community' end - should 'create task when join to closed organization with members' do + should 'create a task when joining a closed organization with members' do community = fast_create(Community) community.update_attribute(:closed, true) - admin = fast_create(Person) + admin = create_user.person community.add_member(admin) login_as profile.identifier @@ -587,7 +587,7 @@ class ProfileControllerTest < ActionController::TestCase should "leave a scrap on another profile" do login_as(profile.identifier) count = Scrap.count - another_person = fast_create(Person) + another_person = create_user.person assert another_person.scraps_received.empty? post :leave_scrap, :profile => another_person.identifier, :scrap => {:content => 'something'} assert_equal count + 1, Scrap.count @@ -645,7 +645,7 @@ class ProfileControllerTest < ActionController::TestCase should "the sender be the logged user by default" do login_as(profile.identifier) count = Scrap.count - another_person = fast_create(Person) + another_person = create_user.person post :leave_scrap, :profile => another_person.identifier, :scrap => {:content => 'something'} last = Scrap.last assert_equal profile, last.sender @@ -654,7 +654,7 @@ class ProfileControllerTest < ActionController::TestCase should "the receiver be the current profile by default" do login_as(profile.identifier) count = Scrap.count - another_person = fast_create(Person) + another_person = create_user.person post :leave_scrap, :profile => another_person.identifier, :scrap => {:content => 'something'} last = Scrap.last assert_equal another_person, last.receiver @@ -686,8 +686,8 @@ class ProfileControllerTest < ActionController::TestCase end should 'not display activities of the current profile when he is not followed by the viewer' do - p1= fast_create(Person) - p2= fast_create(Person) + p1= create_user.person + p2= create_user.person UserStampSweeper.any_instance.stubs(:current_user).returns(p1) scrap1 = create(Scrap, defaults_for_scrap(:sender => p1, :receiver => p2)) @@ -714,9 +714,9 @@ class ProfileControllerTest < ActionController::TestCase end should 'not see the friends activities in the current profile' do - p2= fast_create(Person) + p2 = create_user.person assert !profile.is_a_friend?(p2) - p3= fast_create(Person) + p3 = create_user.person p3.add_friend(profile) assert p3.is_a_friend?(profile) ActionTracker::Record.destroy_all @@ -810,10 +810,10 @@ class ProfileControllerTest < ActionController::TestCase end should 'the network activity be visible only to logged users' do - p1= fast_create(Person) - p2= fast_create(Person) + p1= create_user.person + p2= create_user.person assert !p1.is_a_friend?(p2) - p3= fast_create(Person) + p3= create_user.person p3.add_friend(p1) assert p3.is_a_friend?(p1) ActionTracker::Record.destroy_all @@ -872,10 +872,10 @@ class ProfileControllerTest < ActionController::TestCase end should 'the self activity not crashes with user not logged in' do - p1= fast_create(Person) - p2= fast_create(Person) + p1= create_user.person + p2= create_user.person assert !p1.is_a_friend?(p2) - p3= fast_create(Person) + p3= create_user.person p3.add_friend(p1) assert p3.is_a_friend?(p1) ActionTracker::Record.destroy_all -- libgit2 0.21.2