From 2937a8f311a362b1bb76f91be94d49c27ab5530d Mon Sep 17 00:00:00 2001 From: Gabriel Silva Date: Fri, 12 Aug 2016 12:58:43 +0000 Subject: [PATCH] Fixes ExternalPerson and Friendships unit tests --- app/models/friendship.rb | 3 --- test/unit/friendship_test.rb | 8 ++++---- test/unit/profile_followers_test.rb | 6 +++--- vendor/plugins/action_tracker/lib/action_tracker.rb | 6 ------ 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/app/models/friendship.rb b/app/models/friendship.rb index 7cf1395..7a6927b 100644 --- a/app/models/friendship.rb +++ b/app/models/friendship.rb @@ -10,9 +10,6 @@ class Friendship < ApplicationRecord Friendship.update_cache_counter(:friends_count, friendship.person, 1) Friendship.update_cache_counter(:friends_count, friendship.friend, 1) - p "*"*60 - p "BEFORE CIRCLES" - p "*"*60 circles = friendship.group.blank? ? ['friendships'] : friendship.group.split(',').map(&:strip) circles.each do |circle| friendship.person.follow(friendship.friend, Circle.find_or_create_by(:person => friendship.person, :name => circle, :profile_type => 'Person')) diff --git a/test/unit/friendship_test.rb b/test/unit/friendship_test.rb index 05778e8..c5fd147 100644 --- a/test/unit/friendship_test.rb +++ b/test/unit/friendship_test.rb @@ -81,8 +81,8 @@ class FriendshipTest < ActiveSupport::TestCase p2.add_friend(p1, 'friends') end - assert_includes p1.followers(true), p2 - assert_includes p2.followers(true), p1 + assert_includes p1.followers, p2 + assert_includes p2.followers, p1 end should 'remove follower when a friend removal occurs' do @@ -94,8 +94,8 @@ class FriendshipTest < ActiveSupport::TestCase Friendship.remove_friendship(p1, p2) - assert_not_includes p1.followers(true), p2 - assert_not_includes p2.followers(true), p1 + assert_not_includes p1.followers, p2 + assert_not_includes p2.followers, p1 end should 'keep friendship intact when stop following' do diff --git a/test/unit/profile_followers_test.rb b/test/unit/profile_followers_test.rb index 89684e3..225a765 100644 --- a/test/unit/profile_followers_test.rb +++ b/test/unit/profile_followers_test.rb @@ -11,8 +11,8 @@ class ProfileFollowersTest < ActiveSupport::TestCase p1.follow(p2, circle) end - assert_includes p2.followers(true), p1 - assert_not_includes p1.followers(true), p2 + assert_includes p2.followers, p1 + assert_not_includes p1.followers, p2 end should 'a person unfollow another person' do @@ -26,7 +26,7 @@ class ProfileFollowersTest < ActiveSupport::TestCase p1.unfollow(p2) end - assert_not_includes p2.followers(true), p1 + assert_not_includes p2.followers, p1 end should 'get the followed persons for a profile' do diff --git a/vendor/plugins/action_tracker/lib/action_tracker.rb b/vendor/plugins/action_tracker/lib/action_tracker.rb index 9cd5f94..ef8e414 100644 --- a/vendor/plugins/action_tracker/lib/action_tracker.rb +++ b/vendor/plugins/action_tracker/lib/action_tracker.rb @@ -95,9 +95,6 @@ module ActionTracker return nil if user.nil? if keep_params.is_a? Array stored_params = {} - p "&"*40 - p "keep_params: #{keep_params}" - p "&"*40 keep_params.each do |param| result = self param.to_s.split('.').each { |m| result = result.send(m) } @@ -117,9 +114,6 @@ module ActionTracker Record.new :verb => verb, :params => stored_params, :user => user end tracked_action.target = target || self - p "*"*40 - p "user: #{user}" - p "*"*40 user.tracked_actions << tracked_action post_proc.call tracked_action end -- libgit2 0.21.2