Commit 03614d52e3d3042ca61da09b66dc6f09de47bcd6
1 parent
70359d29
Exists in
master
and in
27 other branches
fix functional tests that fail without notification emails
Showing
1 changed file
with
16 additions
and
16 deletions
Show diff stats
test/functional/profile_controller_test.rb
... | ... | @@ -78,7 +78,7 @@ class ProfileControllerTest < ActionController::TestCase |
78 | 78 | |
79 | 79 | should 'actually add friend' do |
80 | 80 | login_as(@profile.identifier) |
81 | - person = fast_create(Person) | |
81 | + person = create_user.person | |
82 | 82 | assert_difference 'AddFriend.count' do |
83 | 83 | post :add, :profile => person.identifier |
84 | 84 | end |
... | ... | @@ -366,10 +366,10 @@ class ProfileControllerTest < ActionController::TestCase |
366 | 366 | assert profile.memberships.include?(community), 'profile should be actually added to the community' |
367 | 367 | end |
368 | 368 | |
369 | - should 'create task when join to closed organization with members' do | |
369 | + should 'create a task when joining a closed organization with members' do | |
370 | 370 | community = fast_create(Community) |
371 | 371 | community.update_attribute(:closed, true) |
372 | - admin = fast_create(Person) | |
372 | + admin = create_user.person | |
373 | 373 | community.add_member(admin) |
374 | 374 | |
375 | 375 | login_as profile.identifier |
... | ... | @@ -587,7 +587,7 @@ class ProfileControllerTest < ActionController::TestCase |
587 | 587 | should "leave a scrap on another profile" do |
588 | 588 | login_as(profile.identifier) |
589 | 589 | count = Scrap.count |
590 | - another_person = fast_create(Person) | |
590 | + another_person = create_user.person | |
591 | 591 | assert another_person.scraps_received.empty? |
592 | 592 | post :leave_scrap, :profile => another_person.identifier, :scrap => {:content => 'something'} |
593 | 593 | assert_equal count + 1, Scrap.count |
... | ... | @@ -645,7 +645,7 @@ class ProfileControllerTest < ActionController::TestCase |
645 | 645 | should "the sender be the logged user by default" do |
646 | 646 | login_as(profile.identifier) |
647 | 647 | count = Scrap.count |
648 | - another_person = fast_create(Person) | |
648 | + another_person = create_user.person | |
649 | 649 | post :leave_scrap, :profile => another_person.identifier, :scrap => {:content => 'something'} |
650 | 650 | last = Scrap.last |
651 | 651 | assert_equal profile, last.sender |
... | ... | @@ -654,7 +654,7 @@ class ProfileControllerTest < ActionController::TestCase |
654 | 654 | should "the receiver be the current profile by default" do |
655 | 655 | login_as(profile.identifier) |
656 | 656 | count = Scrap.count |
657 | - another_person = fast_create(Person) | |
657 | + another_person = create_user.person | |
658 | 658 | post :leave_scrap, :profile => another_person.identifier, :scrap => {:content => 'something'} |
659 | 659 | last = Scrap.last |
660 | 660 | assert_equal another_person, last.receiver |
... | ... | @@ -686,8 +686,8 @@ class ProfileControllerTest < ActionController::TestCase |
686 | 686 | end |
687 | 687 | |
688 | 688 | should 'not display activities of the current profile when he is not followed by the viewer' do |
689 | - p1= fast_create(Person) | |
690 | - p2= fast_create(Person) | |
689 | + p1= create_user.person | |
690 | + p2= create_user.person | |
691 | 691 | |
692 | 692 | UserStampSweeper.any_instance.stubs(:current_user).returns(p1) |
693 | 693 | scrap1 = create(Scrap, defaults_for_scrap(:sender => p1, :receiver => p2)) |
... | ... | @@ -714,9 +714,9 @@ class ProfileControllerTest < ActionController::TestCase |
714 | 714 | end |
715 | 715 | |
716 | 716 | should 'not see the friends activities in the current profile' do |
717 | - p2= fast_create(Person) | |
717 | + p2 = create_user.person | |
718 | 718 | assert !profile.is_a_friend?(p2) |
719 | - p3= fast_create(Person) | |
719 | + p3 = create_user.person | |
720 | 720 | p3.add_friend(profile) |
721 | 721 | assert p3.is_a_friend?(profile) |
722 | 722 | ActionTracker::Record.destroy_all |
... | ... | @@ -810,10 +810,10 @@ class ProfileControllerTest < ActionController::TestCase |
810 | 810 | end |
811 | 811 | |
812 | 812 | should 'the network activity be visible only to logged users' do |
813 | - p1= fast_create(Person) | |
814 | - p2= fast_create(Person) | |
813 | + p1= create_user.person | |
814 | + p2= create_user.person | |
815 | 815 | assert !p1.is_a_friend?(p2) |
816 | - p3= fast_create(Person) | |
816 | + p3= create_user.person | |
817 | 817 | p3.add_friend(p1) |
818 | 818 | assert p3.is_a_friend?(p1) |
819 | 819 | ActionTracker::Record.destroy_all |
... | ... | @@ -872,10 +872,10 @@ class ProfileControllerTest < ActionController::TestCase |
872 | 872 | end |
873 | 873 | |
874 | 874 | should 'the self activity not crashes with user not logged in' do |
875 | - p1= fast_create(Person) | |
876 | - p2= fast_create(Person) | |
875 | + p1= create_user.person | |
876 | + p2= create_user.person | |
877 | 877 | assert !p1.is_a_friend?(p2) |
878 | - p3= fast_create(Person) | |
878 | + p3= create_user.person | |
879 | 879 | p3.add_friend(p1) |
880 | 880 | assert p3.is_a_friend?(p1) |
881 | 881 | ActionTracker::Record.destroy_all | ... | ... |