fixed broken test from refactoring of followers
This commit is contained in:
parent
95519dc450
commit
cba678616f
|
|
@ -1091,8 +1091,8 @@ module JamRuby
|
|||
end
|
||||
|
||||
def top_followings
|
||||
@topf ||= User.joins("INNER JOIN follows ON follows.followable_id = users.id")
|
||||
.where(['follows.user_id = ?',self.id])
|
||||
@topf ||= User.joins("INNER JOIN follows ON follows.user_id = users.id AND follows.followable_type = '#{self.class.to_s}'")
|
||||
.where(['follows.followable_id = ?',self.id])
|
||||
.order('follows.created_at DESC')
|
||||
.limit(3)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ describe "Musician Search API", :type => :api do
|
|||
musician = json["musicians"][0]
|
||||
expect(musician["id"]).to eq(@user4.id)
|
||||
followings = musician['followings']
|
||||
# expect(followings.length).to be 3
|
||||
expect(followings.length).to be 3
|
||||
expect(musician['follow_count'].to_i).to be > 0
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue