Commit 8bef50d2a64f3cfeefdc33bd63180dfa194f1648

Authored by Rodrigo Souto
1 parent 8d58c842

search-optimizations: fix broken tests

app/models/profile.rb
@@ -608,10 +608,10 @@ private :generate_url, :url_options @@ -608,10 +608,10 @@ private :generate_url, :url_options
608 # Adds a person as member of this Profile. 608 # Adds a person as member of this Profile.
609 def add_member(person) 609 def add_member(person)
610 if self.has_members? 610 if self.has_members?
611 - if self.closed? && members_count > 0 611 + if self.closed? && members.count > 0
612 AddMember.create!(:person => person, :organization => self) unless self.already_request_membership?(person) 612 AddMember.create!(:person => person, :organization => self) unless self.already_request_membership?(person)
613 else 613 else
614 - self.affiliate(person, Profile::Roles.admin(environment.id)) if members_count == 0 614 + self.affiliate(person, Profile::Roles.admin(environment.id)) if members.count == 0
615 self.affiliate(person, Profile::Roles.member(environment.id)) 615 self.affiliate(person, Profile::Roles.member(environment.id))
616 end 616 end
617 else 617 else
test/functional/invite_controller_test.rb
@@ -230,7 +230,8 @@ class InviteControllerTest < ActionController::TestCase @@ -230,7 +230,8 @@ class InviteControllerTest < ActionController::TestCase
230 230
231 contact_list = ContactList.create 231 contact_list = ContactList.create
232 post :select_friends, :profile => profile.identifier, :manual_import_addresses => "#{friend.name} <#{friend.email}>", :import_from => "manual", :mail_template => "click: <url>", :contact_list => contact_list.id 232 post :select_friends, :profile => profile.identifier, :manual_import_addresses => "#{friend.name} <#{friend.email}>", :import_from => "manual", :mail_template => "click: <url>", :contact_list => contact_list.id
233 - assert_equal 'pt', Delayed::Job.first.payload_object.locale 233 + job = Delayed::Job.where("handler LIKE '%InvitationJob%'").first
  234 + assert_equal 'pt', job.payload_object.locale
234 end 235 end
235 236
236 private 237 private
test/functional/profile_controller_test.rb
@@ -766,23 +766,28 @@ class ProfileControllerTest &lt; ActionController::TestCase @@ -766,23 +766,28 @@ class ProfileControllerTest &lt; ActionController::TestCase
766 end 766 end
767 767
768 should 'see all the activities in the current profile network' do 768 should 'see all the activities in the current profile network' do
769 - p1= Person.first 769 + p1= fast_create(Person)
770 p2= fast_create(Person) 770 p2= fast_create(Person)
771 assert !p1.is_a_friend?(p2) 771 assert !p1.is_a_friend?(p2)
  772 +
772 p3= fast_create(Person) 773 p3= fast_create(Person)
773 p3.add_friend(p1) 774 p3.add_friend(p1)
774 assert p3.is_a_friend?(p1) 775 assert p3.is_a_friend?(p1)
775 - ActionTracker::Record.destroy_all 776 +
  777 + ActionTracker::Record.delete_all
  778 +
  779 + UserStampSweeper.any_instance.stubs(:current_user).returns(p1)
776 Scrap.create!(defaults_for_scrap(:sender => p1, :receiver => p1)) 780 Scrap.create!(defaults_for_scrap(:sender => p1, :receiver => p1))
777 a1 = ActionTracker::Record.last 781 a1 = ActionTracker::Record.last
  782 +
778 UserStampSweeper.any_instance.stubs(:current_user).returns(p2) 783 UserStampSweeper.any_instance.stubs(:current_user).returns(p2)
779 Scrap.create!(defaults_for_scrap(:sender => p2, :receiver => p3)) 784 Scrap.create!(defaults_for_scrap(:sender => p2, :receiver => p3))
780 a2 = ActionTracker::Record.last 785 a2 = ActionTracker::Record.last
  786 +
781 UserStampSweeper.any_instance.stubs(:current_user).returns(p3) 787 UserStampSweeper.any_instance.stubs(:current_user).returns(p3)
782 Scrap.create!(defaults_for_scrap(:sender => p3, :receiver => p1)) 788 Scrap.create!(defaults_for_scrap(:sender => p3, :receiver => p1))
783 a3 = ActionTracker::Record.last 789 a3 = ActionTracker::Record.last
784 790
785 -  
786 @controller.stubs(:logged_in?).returns(true) 791 @controller.stubs(:logged_in?).returns(true)
787 user = mock() 792 user = mock()
788 user.stubs(:person).returns(p3) 793 user.stubs(:person).returns(p3)
@@ -792,24 +797,29 @@ class ProfileControllerTest &lt; ActionController::TestCase @@ -792,24 +797,29 @@ class ProfileControllerTest &lt; ActionController::TestCase
792 797
793 process_delayed_job_queue 798 process_delayed_job_queue
794 get :index, :profile => p1.identifier 799 get :index, :profile => p1.identifier
795 - assert_not_nil assigns(:network_activities)  
796 - assert_equal [], [a1,a3] - assigns(:network_activities)  
797 - assert_equal assigns(:network_activities) - [a1, a3], [] 800 +
  801 + assert_equivalent [a1,a3].map(&:id), assigns(:network_activities).map(&:id)
798 end 802 end
799 803
800 should 'the network activity be visible only to profile followers' do 804 should 'the network activity be visible only to profile followers' do
801 - p1= Person.first 805 + p1= fast_create(Person)
802 p2= fast_create(Person) 806 p2= fast_create(Person)
803 assert !p1.is_a_friend?(p2) 807 assert !p1.is_a_friend?(p2)
  808 +
804 p3= fast_create(Person) 809 p3= fast_create(Person)
805 p3.add_friend(p1) 810 p3.add_friend(p1)
806 assert p3.is_a_friend?(p1) 811 assert p3.is_a_friend?(p1)
807 - ActionTracker::Record.destroy_all 812 +
  813 + ActionTracker::Record.delete_all
  814 +
  815 + UserStampSweeper.any_instance.stubs(:current_user).returns(p1)
808 Scrap.create!(defaults_for_scrap(:sender => p1, :receiver => p1)) 816 Scrap.create!(defaults_for_scrap(:sender => p1, :receiver => p1))
809 a1 = ActionTracker::Record.last 817 a1 = ActionTracker::Record.last
  818 +
810 UserStampSweeper.any_instance.stubs(:current_user).returns(p2) 819 UserStampSweeper.any_instance.stubs(:current_user).returns(p2)
811 Scrap.create!(defaults_for_scrap(:sender => p2, :receiver => p3)) 820 Scrap.create!(defaults_for_scrap(:sender => p2, :receiver => p3))
812 a2 = ActionTracker::Record.last 821 a2 = ActionTracker::Record.last
  822 +
813 UserStampSweeper.any_instance.stubs(:current_user).returns(p3) 823 UserStampSweeper.any_instance.stubs(:current_user).returns(p3)
814 Scrap.create!(defaults_for_scrap(:sender => p3, :receiver => p1)) 824 Scrap.create!(defaults_for_scrap(:sender => p3, :receiver => p1))
815 a3 = ActionTracker::Record.last 825 a3 = ActionTracker::Record.last
@@ -819,8 +829,9 @@ class ProfileControllerTest &lt; ActionController::TestCase @@ -819,8 +829,9 @@ class ProfileControllerTest &lt; ActionController::TestCase
819 user.stubs(:person).returns(p2) 829 user.stubs(:person).returns(p2)
820 user.stubs(:login).returns('some') 830 user.stubs(:login).returns('some')
821 @controller.stubs(:current_user).returns(user) 831 @controller.stubs(:current_user).returns(user)
  832 +
822 get :index, :profile => p1.identifier 833 get :index, :profile => p1.identifier
823 - assert_equal [], assigns(:network_activities) 834 + assert assigns(:network_activities).blank?
824 835
825 user = mock() 836 user = mock()
826 user.stubs(:person).returns(p3) 837 user.stubs(:person).returns(p3)
@@ -828,9 +839,9 @@ class ProfileControllerTest &lt; ActionController::TestCase @@ -828,9 +839,9 @@ class ProfileControllerTest &lt; ActionController::TestCase
828 @controller.stubs(:current_user).returns(user) 839 @controller.stubs(:current_user).returns(user)
829 Person.any_instance.stubs(:follows?).returns(true) 840 Person.any_instance.stubs(:follows?).returns(true)
830 process_delayed_job_queue 841 process_delayed_job_queue
  842 +
831 get :index, :profile => p3.identifier 843 get :index, :profile => p3.identifier
832 - assert_equal [], [a1,a3] - assigns(:network_activities)  
833 - assert_equal assigns(:network_activities) - [a1, a3], [] 844 + assert_equivalent [a1,a3], assigns(:network_activities)
834 end 845 end
835 846
836 should 'the network activity be paginated' do 847 should 'the network activity be paginated' do
test/functional/search_controller_test.rb
@@ -549,9 +549,9 @@ class SearchControllerTest &lt; ActionController::TestCase @@ -549,9 +549,9 @@ class SearchControllerTest &lt; ActionController::TestCase
549 c2 = create(Community, :name => 'Testing community 2') 549 c2 = create(Community, :name => 'Testing community 2')
550 c3 = create(Community, :name => 'Testing community 3') 550 c3 = create(Community, :name => 'Testing community 3')
551 ActionTracker::Record.delete_all 551 ActionTracker::Record.delete_all
552 - fast_create(ActionTracker::Record, :target_id => c1, :user_type => 'Profile', :user_id => person, :created_at => Time.now)  
553 - fast_create(ActionTracker::Record, :target_id => c2, :user_type => 'Profile', :user_id => person, :created_at => Time.now)  
554 - fast_create(ActionTracker::Record, :target_id => c2, :user_type => 'Profile', :user_id => person, :created_at => Time.now) 552 + ActionTracker::Record.create!(:target => c1, :user => person, :created_at => Time.now, :verb => 'leave_scrap')
  553 + ActionTracker::Record.create!(:target => c2, :user => person, :created_at => Time.now, :verb => 'leave_scrap')
  554 + ActionTracker::Record.create!(:target => c2, :user => person, :created_at => Time.now, :verb => 'leave_scrap')
555 get :communities, :filter => 'more_active' 555 get :communities, :filter => 'more_active'
556 assert_equal [c2,c1,c3] , assigns(:searches)[:communities][:results] 556 assert_equal [c2,c1,c3] , assigns(:searches)[:communities][:results]
557 end 557 end
test/unit/action_tracker_ext_test.rb
@@ -12,6 +12,7 @@ class ActionTrackerExtTest &lt; ActiveSupport::TestCase @@ -12,6 +12,7 @@ class ActionTrackerExtTest &lt; ActiveSupport::TestCase
12 should 'decrease person activities_count on activity removal' do 12 should 'decrease person activities_count on activity removal' do
13 person = fast_create(Person) 13 person = fast_create(Person)
14 record = ActionTracker::Record.create! :verb => :leave_scrap, :user => person, :target => fast_create(Profile) 14 record = ActionTracker::Record.create! :verb => :leave_scrap, :user => person, :target => fast_create(Profile)
  15 + person.reload
15 assert_difference person, :activities_count, -1 do 16 assert_difference person, :activities_count, -1 do
16 record.destroy 17 record.destroy
17 person.reload 18 person.reload
@@ -23,6 +24,7 @@ class ActionTrackerExtTest &lt; ActiveSupport::TestCase @@ -23,6 +24,7 @@ class ActionTrackerExtTest &lt; ActiveSupport::TestCase
23 record = ActionTracker::Record.create! :verb => :leave_scrap, :user => person, :target => fast_create(Profile) 24 record = ActionTracker::Record.create! :verb => :leave_scrap, :user => person, :target => fast_create(Profile)
24 record.created_at = record.created_at - ActionTracker::Record::RECENT_DELAY.days - 1.day 25 record.created_at = record.created_at - ActionTracker::Record::RECENT_DELAY.days - 1.day
25 record.save! 26 record.save!
  27 + person.reload
26 assert_no_difference person, :activities_count do 28 assert_no_difference person, :activities_count do
27 record.destroy 29 record.destroy
28 person.reload 30 person.reload
@@ -42,6 +44,7 @@ class ActionTrackerExtTest &lt; ActiveSupport::TestCase @@ -42,6 +44,7 @@ class ActionTrackerExtTest &lt; ActiveSupport::TestCase
42 person = fast_create(Person) 44 person = fast_create(Person)
43 organization = fast_create(Organization) 45 organization = fast_create(Organization)
44 record = ActionTracker::Record.create! :verb => :leave_scrap, :user => person, :target => organization 46 record = ActionTracker::Record.create! :verb => :leave_scrap, :user => person, :target => organization
  47 + organization.reload
45 assert_difference organization, :activities_count, -1 do 48 assert_difference organization, :activities_count, -1 do
46 record.destroy 49 record.destroy
47 organization.reload 50 organization.reload
@@ -52,6 +55,7 @@ class ActionTrackerExtTest &lt; ActiveSupport::TestCase @@ -52,6 +55,7 @@ class ActionTrackerExtTest &lt; ActiveSupport::TestCase
52 person = fast_create(Person) 55 person = fast_create(Person)
53 organization = fast_create(Organization) 56 organization = fast_create(Organization)
54 record = ActionTracker::Record.create! :verb => :leave_scrap, :user => person, :target => organization, :created_at => (ActionTracker::Record::RECENT_DELAY + 1).days.ago 57 record = ActionTracker::Record.create! :verb => :leave_scrap, :user => person, :target => organization, :created_at => (ActionTracker::Record::RECENT_DELAY + 1).days.ago
  58 + organization.reload
55 assert_no_difference organization, :activities_count do 59 assert_no_difference organization, :activities_count do
56 record.destroy 60 record.destroy
57 organization.reload 61 organization.reload
test/unit/activities_counter_cache_job_test.rb
@@ -6,6 +6,7 @@ class ActivitiesCounterCacheJobTest &lt; ActiveSupport::TestCase @@ -6,6 +6,7 @@ class ActivitiesCounterCacheJobTest &lt; ActiveSupport::TestCase
6 person = create_user('person').person 6 person = create_user('person').person
7 ActionTracker::Record.create!(:user => person, :verb => 'create_article') 7 ActionTracker::Record.create!(:user => person, :verb => 'create_article')
8 ActionTracker::Record.create!(:user => person, :verb => 'create_article') 8 ActionTracker::Record.create!(:user => person, :verb => 'create_article')
  9 + person.reload
9 assert_equal 2, person.activities_count 10 assert_equal 2, person.activities_count
10 11
11 person.activities_count = 0 12 person.activities_count = 0
@@ -21,6 +22,7 @@ class ActivitiesCounterCacheJobTest &lt; ActiveSupport::TestCase @@ -21,6 +22,7 @@ class ActivitiesCounterCacheJobTest &lt; ActiveSupport::TestCase
21 organization = Organization.create!(:name => 'Organization1', :identifier => 'organization1') 22 organization = Organization.create!(:name => 'Organization1', :identifier => 'organization1')
22 ActionTracker::Record.create!(:user => person, :verb => 'create_article', :target => organization) 23 ActionTracker::Record.create!(:user => person, :verb => 'create_article', :target => organization)
23 ActionTracker::Record.create!(:user => person, :verb => 'create_article', :target => organization) 24 ActionTracker::Record.create!(:user => person, :verb => 'create_article', :target => organization)
  25 + organization.reload
24 assert_equal 2, organization.activities_count 26 assert_equal 2, organization.activities_count
25 27
26 organization.activities_count = 0 28 organization.activities_count = 0
test/unit/article_test.rb
@@ -1625,10 +1625,10 @@ class ArticleTest &lt; ActiveSupport::TestCase @@ -1625,10 +1625,10 @@ class ArticleTest &lt; ActiveSupport::TestCase
1625 1625
1626 should 'not allow all community members to edit by default' do 1626 should 'not allow all community members to edit by default' do
1627 community = fast_create(Community) 1627 community = fast_create(Community)
1628 - admin = create_user('community-admin').person  
1629 - member = create_user.person  
1630 - 1628 + admin = fast_create(Person)
  1629 + member = fast_create(Person)
1631 community.add_admin(admin) 1630 community.add_admin(admin)
  1631 + community.reload
1632 community.add_member(member) 1632 community.add_member(member)
1633 a = Article.new(:profile => community) 1633 a = Article.new(:profile => community)
1634 1634
test/unit/organization_mailing_test.rb
@@ -62,18 +62,21 @@ class OrganizationMailingTest &lt; ActiveSupport::TestCase @@ -62,18 +62,21 @@ class OrganizationMailingTest &lt; ActiveSupport::TestCase
62 62
63 should 'deliver mailing to each member after create' do 63 should 'deliver mailing to each member after create' do
64 mailing = OrganizationMailing.create(:source => community, :subject => 'Hello', :body => 'We have some news', :person => person) 64 mailing = OrganizationMailing.create(:source => community, :subject => 'Hello', :body => 'We have some news', :person => person)
  65 + community.reload
65 process_delayed_job_queue 66 process_delayed_job_queue
66 assert_equal 2, ActionMailer::Base.deliveries.count 67 assert_equal 2, ActionMailer::Base.deliveries.count
67 end 68 end
68 69
69 should 'deliver mailing when there are many mailings created' do 70 should 'deliver mailing when there are many mailings created' do
70 50.times { OrganizationMailing.create(:source => community, :subject => 'Hello', :body => 'We have some news', :person => person) } 71 50.times { OrganizationMailing.create(:source => community, :subject => 'Hello', :body => 'We have some news', :person => person) }
  72 + community.reload
71 process_delayed_job_queue 73 process_delayed_job_queue
72 assert_equal 50*community.members_count, ActionMailer::Base.deliveries.count 74 assert_equal 50*community.members_count, ActionMailer::Base.deliveries.count
73 end 75 end
74 76
75 should 'create mailing sent to each recipient after delivering mailing' do 77 should 'create mailing sent to each recipient after delivering mailing' do
76 mailing = OrganizationMailing.create(:source => community, :subject => 'Hello', :body => 'We have some news', :person => person) 78 mailing = OrganizationMailing.create(:source => community, :subject => 'Hello', :body => 'We have some news', :person => person)
  79 + community.reload
77 assert_difference MailingSent, :count, 2 do 80 assert_difference MailingSent, :count, 2 do
78 process_delayed_job_queue 81 process_delayed_job_queue
79 end 82 end
test/unit/person_test.rb
@@ -407,11 +407,11 @@ class PersonTest &lt; ActiveSupport::TestCase @@ -407,11 +407,11 @@ class PersonTest &lt; ActiveSupport::TestCase
407 admin = fast_create(Person) 407 admin = fast_create(Person)
408 community.add_member(admin) 408 community.add_member(admin)
409 member = fast_create(Person) 409 member = fast_create(Person)
  410 + community.reload
410 community.add_member(member) 411 community.add_member(member)
411 community.tasks << Task.new 412 community.tasks << Task.new
412 413
413 -  
414 - assert_not_includes Person.with_pending_tasks, person 414 + assert_not_includes Person.with_pending_tasks, member
415 end 415 end
416 416
417 should 'person has organization pending tasks' do 417 should 'person has organization pending tasks' do
@@ -641,17 +641,16 @@ class PersonTest &lt; ActiveSupport::TestCase @@ -641,17 +641,16 @@ class PersonTest &lt; ActiveSupport::TestCase
641 end 641 end
642 642
643 should 'find more popular people' do 643 should 'find more popular people' do
  644 + extend CacheCounterHelper
  645 +
644 Person.delete_all 646 Person.delete_all
645 p1 = fast_create(Person) 647 p1 = fast_create(Person)
646 p2 = fast_create(Person) 648 p2 = fast_create(Person)
647 p3 = fast_create(Person) 649 p3 = fast_create(Person)
648 650
649 - p1.friends_count = 1  
650 - p2.friends_count = 2  
651 - p3.friends_count = 3  
652 - p1.save!  
653 - p2.save!  
654 - p3.save! 651 + update_cache_counter(:friends_count, p1, 1)
  652 + update_cache_counter(:friends_count, p2, 2)
  653 + update_cache_counter(:friends_count, p3, 3)
655 654
656 assert_order [p3, p2, p1], Person.more_popular 655 assert_order [p3, p2, p1], Person.more_popular
657 end 656 end
@@ -893,6 +892,7 @@ class PersonTest &lt; ActiveSupport::TestCase @@ -893,6 +892,7 @@ class PersonTest &lt; ActiveSupport::TestCase
893 p1 = fast_create(Person) 892 p1 = fast_create(Person)
894 p2 = fast_create(Person) 893 p2 = fast_create(Person)
895 p3 = fast_create(Person) 894 p3 = fast_create(Person)
  895 + p4 = fast_create(Person)
896 896
897 community.add_member(p1) 897 community.add_member(p1)
898 assert p1.is_member_of?(community) 898 assert p1.is_member_of?(community)
@@ -1136,12 +1136,12 @@ class PersonTest &lt; ActiveSupport::TestCase @@ -1136,12 +1136,12 @@ class PersonTest &lt; ActiveSupport::TestCase
1136 p3 = fast_create(Person) 1136 p3 = fast_create(Person)
1137 1137
1138 ActionTracker::Record.destroy_all 1138 ActionTracker::Record.destroy_all
1139 - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => p1)  
1140 - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => p2)  
1141 - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => p2)  
1142 - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => p3)  
1143 - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => p3)  
1144 - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => p3) 1139 + ActionTracker::Record.create!(:user => p1, :verb => 'leave_scrap')
  1140 + ActionTracker::Record.create!(:user => p2, :verb => 'leave_scrap')
  1141 + ActionTracker::Record.create!(:user => p2, :verb => 'leave_scrap')
  1142 + ActionTracker::Record.create!(:user => p3, :verb => 'leave_scrap')
  1143 + ActionTracker::Record.create!(:user => p3, :verb => 'leave_scrap')
  1144 + ActionTracker::Record.create!(:user => p3, :verb => 'leave_scrap')
1145 1145
1146 assert_order [p3,p2,p1] , Person.more_active 1146 assert_order [p3,p2,p1] , Person.more_active
1147 end 1147 end
test/unit/role_assignment_ext_test.rb
@@ -20,6 +20,7 @@ class RoleAssignmentExtTest &lt; ActiveSupport::TestCase @@ -20,6 +20,7 @@ class RoleAssignmentExtTest &lt; ActiveSupport::TestCase
20 organization = Organization.create!(:name => 'Organization', :identifier => 'organization') 20 organization = Organization.create!(:name => 'Organization', :identifier => 'organization')
21 RoleAssignment.create!(:accessor => member, :resource => organization, :role => role1) 21 RoleAssignment.create!(:accessor => member, :resource => organization, :role => role1)
22 RoleAssignment.create!(:accessor => member, :resource => organization, :role => role2) 22 RoleAssignment.create!(:accessor => member, :resource => organization, :role => role2)
  23 + organization.reload
23 assert_difference organization, :members_count, -1 do 24 assert_difference organization, :members_count, -1 do
24 organization.role_assignments.destroy_all 25 organization.role_assignments.destroy_all
25 organization.reload 26 organization.reload
test/unit/uploaded_file_test.rb
@@ -327,12 +327,13 @@ class UploadedFileTest &lt; ActiveSupport::TestCase @@ -327,12 +327,13 @@ class UploadedFileTest &lt; ActiveSupport::TestCase
327 327
328 should 'group trackers activity of image\'s upload' do 328 should 'group trackers activity of image\'s upload' do
329 gallery = fast_create(Gallery, :profile_id => profile.id) 329 gallery = fast_create(Gallery, :profile_id => profile.id)
330 - 330 + count = ActionTracker::Record.find_all_by_verb('upload_image').count
331 image1 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :parent => gallery, :profile => profile) 331 image1 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :parent => gallery, :profile => profile)
332 - assert_equal 1, ActionTracker::Record.find_all_by_verb('upload_image').count 332 + count += 1
  333 + assert_equal count, ActionTracker::Record.find_all_by_verb('upload_image').count
333 334
334 image2 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'), :parent => gallery, :profile => profile) 335 image2 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'), :parent => gallery, :profile => profile)
335 - assert_equal 1, ActionTracker::Record.find_all_by_verb('upload_image').count 336 + assert_equal count, ActionTracker::Record.find_all_by_verb('upload_image').count
336 end 337 end
337 338
338 { 339 {