TEST: TopicViewItem ip logging test
This commit is contained in:
parent
94f70c7b5c
commit
13a5e41fca
|
@ -27,4 +27,14 @@ describe TopicViewItem do
|
|||
expect(user.user_stat.topics_entered).to eq(1)
|
||||
end
|
||||
|
||||
it "does not log IP address for logged-in users" do
|
||||
topic = Fabricate(:topic)
|
||||
user = Fabricate(:user)
|
||||
add(topic.id, "1.1.1.1", user.id)
|
||||
|
||||
expect(TopicViewItem.find_by(topic_id: topic.id, user_id: user.id).ip_address).to eq(nil)
|
||||
add(topic.id, "1.2.3.4", nil)
|
||||
expect(TopicViewItem.find_by(topic_id: topic.id, user_id: nil).ip_address).to eq("1.2.3.4")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue