FIX: stop logging way too much information

This commit is contained in:
Sam
2014-08-05 16:14:10 +10:00
parent 40bcead099
commit 3cab3acd60
4 changed files with 31 additions and 11 deletions

View File

@ -1,5 +1,20 @@
require 'spec_helper'
describe TopicView do
describe TopicViewItem do
def add(topic_id, ip, user_id=nil)
skip_redis = true
TopicViewItem.add(topic_id, ip, user_id, nil, skip_redis)
end
it "raises nothing for dupes" do
add(2, "1.1.1.1")
add(2, "1.1.1.1", 1)
TopicViewItem.create!(topic_id: 1, ip_address: "1.1.1.1", viewed_at: 1.day.ago)
add(1, "1.1.1.1")
TopicViewItem.count.should == 3
end
end