mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
push some work out of AR callbacks into PostCreator, add a couple of helpers for post and topic creation in test
fix it so the auto_track false marks topics as new
This commit is contained in:
parent
0ec1438b9a
commit
58e7c3e1f3
15 changed files with 89 additions and 95 deletions
|
@ -7,7 +7,7 @@ describe TopicTrackingState do
|
|||
end
|
||||
|
||||
let(:post) do
|
||||
Fabricate(:post)
|
||||
create_post
|
||||
end
|
||||
|
||||
it "can correctly publish unread" do
|
||||
|
@ -39,7 +39,7 @@ describe TopicTrackingState do
|
|||
TopicTrackingState.report([user.id], post.topic_id + 1).should be_empty
|
||||
|
||||
# when we reply the poster should have an unread row
|
||||
Fabricate(:post, user: user, topic: post.topic)
|
||||
create_post(user: user, topic: post.topic)
|
||||
|
||||
report = TopicTrackingState.report([post.user_id, user.id])
|
||||
report.length.should == 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue