mirror of
https://github.com/zhigang1992/tsemple.git
synced 2026-04-30 05:35:29 +08:00
14 lines
296 B
Ruby
14 lines
296 B
Ruby
require 'test_helper'
|
|
|
|
class TopicTest < ActiveSupport::TestCase
|
|
test "should calculate hot" do
|
|
topic = create(:topic)
|
|
assert_equal topic.created_at.to_i / 45000, topic.reload.hot
|
|
|
|
old_hot = topic.hot
|
|
|
|
create(:post, topic: topic)
|
|
assert topic.reload.hot > old_hot
|
|
end
|
|
end
|