mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 11:11:13 +08:00
update message bus to support per client filtering
start work on user_tracking_state fix can_ban? in guardian expose protected scopes on topic_query we need move guardian spec to use build as opposed to creating topics / posts / users start work on user tracking spec
This commit is contained in:
34
spec/models/user_tracking_state_spec.rb
Normal file
34
spec/models/user_tracking_state_spec.rb
Normal file
@ -0,0 +1,34 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe UserTrackingState do
|
||||
|
||||
let(:user) do
|
||||
Fabricate(:user)
|
||||
end
|
||||
|
||||
let(:post) do
|
||||
Fabricate(:post)
|
||||
end
|
||||
|
||||
let(:state) do
|
||||
UserTrackingState.new(user)
|
||||
end
|
||||
|
||||
it "correctly gets the list of new topics" do
|
||||
state.new_list.should == []
|
||||
state.unread_list.should == []
|
||||
|
||||
new_post = post
|
||||
|
||||
new_list = state.new_list
|
||||
|
||||
new_list.length.should == 1
|
||||
new_list[0][0].should == post.topic.id
|
||||
new_list[0][1].should be_within(1.second).of(post.topic.created_at)
|
||||
|
||||
state.unread_list.should == []
|
||||
|
||||
# read it
|
||||
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user