mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:00:32 -06:00
fix pending tests
This commit is contained in:
parent
8b69ee26ff
commit
ef976ba891
@ -37,7 +37,7 @@ describe PostCreator do
|
||||
creator.spam?.should be_false
|
||||
end
|
||||
|
||||
pending 'generates the correct messages for a secure topic' do
|
||||
it 'generates the correct messages for a secure topic' do
|
||||
|
||||
admin = Fabricate(:admin)
|
||||
|
||||
@ -57,17 +57,19 @@ describe PostCreator do
|
||||
topic_id = created_post.topic_id
|
||||
|
||||
|
||||
messages.map{|m| m.channel}.sort.should == [ "/latest",
|
||||
messages.map{|m| m.channel}.sort.should == [ "/new",
|
||||
"/users/#{admin.username}",
|
||||
"/users/#{admin.username}",
|
||||
"/topic/#{created_post.topic_id}",
|
||||
"/category/#{cat.slug}"
|
||||
"/unread/#{admin.id}",
|
||||
"/unread/#{admin.id}",
|
||||
"/topic/#{created_post.topic_id}"
|
||||
].sort
|
||||
admin_ids = [Group[:admins].id]
|
||||
messages.any?{|m| m.group_ids != admin_ids}.should be_false
|
||||
|
||||
messages.any?{|m| m.group_ids != admin_ids && m.user_ids != [admin.id]}.should be_false
|
||||
end
|
||||
|
||||
pending 'generates the correct messages for a normal topic' do
|
||||
it 'generates the correct messages for a normal topic' do
|
||||
|
||||
p = nil
|
||||
messages = MessageBus.track_publish do
|
||||
@ -75,13 +77,16 @@ describe PostCreator do
|
||||
topic_id = p.topic_id
|
||||
end
|
||||
|
||||
latest = messages.find{|m| m.channel == "/latest"}
|
||||
latest = messages.find{|m| m.channel == "/new"}
|
||||
latest.should_not be_nil
|
||||
|
||||
read = messages.find{|m| m.channel == "/unread/#{p.user_id}"}
|
||||
read.should_not be_nil
|
||||
|
||||
user_action = messages.find{|m| m.channel == "/users/#{p.user.username}"}
|
||||
user_action.should_not be_nil
|
||||
|
||||
messages.length.should == 2
|
||||
messages.length.should == 3
|
||||
end
|
||||
|
||||
it 'extracts links from the post' do
|
||||
|
Loading…
Reference in New Issue
Block a user