discourse/spec/fabricators/incoming_link_fabricator.rb
riking 728e8a262c FIX: Admin panel referral stats not counting topics correctly
Due to what seems to be a bug in ActiveRecord, the distinct: true option
is not recognized on counts with string column names. This commit fixes
that by moving the DISTINCT into the count string.

For robustness, the integration spec for IncomingLinksReport was
rewritten to be an actual integration spec, running the actual interface
on actual fake data.
2014-11-24 12:16:52 -08:00

6 lines
136 B
Ruby

Fabricator(:incoming_link) do
user
post
ip_address { sequence(:ip_address) { |n| "123.#{(n*3)%255}.#{(n*2)%255}.#{n%255}" } }
end