Commit 2937a8f311a362b1bb76f91be94d49c27ab5530d
1 parent
a0c06c26
Fixes ExternalPerson and Friendships unit tests
Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
Showing
4 changed files
with
7 additions
and
16 deletions
Show diff stats
app/models/friendship.rb
| ... | ... | @@ -10,9 +10,6 @@ class Friendship < ApplicationRecord |
| 10 | 10 | Friendship.update_cache_counter(:friends_count, friendship.person, 1) |
| 11 | 11 | Friendship.update_cache_counter(:friends_count, friendship.friend, 1) |
| 12 | 12 | |
| 13 | - p "*"*60 | |
| 14 | - p "BEFORE CIRCLES" | |
| 15 | - p "*"*60 | |
| 16 | 13 | circles = friendship.group.blank? ? ['friendships'] : friendship.group.split(',').map(&:strip) |
| 17 | 14 | circles.each do |circle| |
| 18 | 15 | friendship.person.follow(friendship.friend, Circle.find_or_create_by(:person => friendship.person, :name => circle, :profile_type => 'Person')) | ... | ... |
test/unit/friendship_test.rb
| ... | ... | @@ -81,8 +81,8 @@ class FriendshipTest < ActiveSupport::TestCase |
| 81 | 81 | p2.add_friend(p1, 'friends') |
| 82 | 82 | end |
| 83 | 83 | |
| 84 | - assert_includes p1.followers(true), p2 | |
| 85 | - assert_includes p2.followers(true), p1 | |
| 84 | + assert_includes p1.followers, p2 | |
| 85 | + assert_includes p2.followers, p1 | |
| 86 | 86 | end |
| 87 | 87 | |
| 88 | 88 | should 'remove follower when a friend removal occurs' do |
| ... | ... | @@ -94,8 +94,8 @@ class FriendshipTest < ActiveSupport::TestCase |
| 94 | 94 | |
| 95 | 95 | Friendship.remove_friendship(p1, p2) |
| 96 | 96 | |
| 97 | - assert_not_includes p1.followers(true), p2 | |
| 98 | - assert_not_includes p2.followers(true), p1 | |
| 97 | + assert_not_includes p1.followers, p2 | |
| 98 | + assert_not_includes p2.followers, p1 | |
| 99 | 99 | end |
| 100 | 100 | |
| 101 | 101 | should 'keep friendship intact when stop following' do | ... | ... |
test/unit/profile_followers_test.rb
| ... | ... | @@ -11,8 +11,8 @@ class ProfileFollowersTest < ActiveSupport::TestCase |
| 11 | 11 | p1.follow(p2, circle) |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | - assert_includes p2.followers(true), p1 | |
| 15 | - assert_not_includes p1.followers(true), p2 | |
| 14 | + assert_includes p2.followers, p1 | |
| 15 | + assert_not_includes p1.followers, p2 | |
| 16 | 16 | end |
| 17 | 17 | |
| 18 | 18 | should 'a person unfollow another person' do |
| ... | ... | @@ -26,7 +26,7 @@ class ProfileFollowersTest < ActiveSupport::TestCase |
| 26 | 26 | p1.unfollow(p2) |
| 27 | 27 | end |
| 28 | 28 | |
| 29 | - assert_not_includes p2.followers(true), p1 | |
| 29 | + assert_not_includes p2.followers, p1 | |
| 30 | 30 | end |
| 31 | 31 | |
| 32 | 32 | should 'get the followed persons for a profile' do | ... | ... |
vendor/plugins/action_tracker/lib/action_tracker.rb
| ... | ... | @@ -95,9 +95,6 @@ module ActionTracker |
| 95 | 95 | return nil if user.nil? |
| 96 | 96 | if keep_params.is_a? Array |
| 97 | 97 | stored_params = {} |
| 98 | - p "&"*40 | |
| 99 | - p "keep_params: #{keep_params}" | |
| 100 | - p "&"*40 | |
| 101 | 98 | keep_params.each do |param| |
| 102 | 99 | result = self |
| 103 | 100 | param.to_s.split('.').each { |m| result = result.send(m) } |
| ... | ... | @@ -117,9 +114,6 @@ module ActionTracker |
| 117 | 114 | Record.new :verb => verb, :params => stored_params, :user => user |
| 118 | 115 | end |
| 119 | 116 | tracked_action.target = target || self |
| 120 | - p "*"*40 | |
| 121 | - p "user: #{user}" | |
| 122 | - p "*"*40 | |
| 123 | 117 | user.tracked_actions << tracked_action |
| 124 | 118 | post_proc.call tracked_action |
| 125 | 119 | end | ... | ... |