mirror of
https://github.com/discourse/discourse.git
synced 2025-03-04 01:23:10 +08:00
correct spec
This commit is contained in:
parent
6125b675b6
commit
8240a00829
@ -637,14 +637,18 @@ describe Topic do
|
||||
describe "make_banner!" do
|
||||
|
||||
it "changes the topic archetype to 'banner'" do
|
||||
topic.expects(:add_moderator_post)
|
||||
MessageBus.expects(:publish).with("/site/banner", banner)
|
||||
topic.make_banner!(user)
|
||||
topic.archetype.should == Archetype.banner
|
||||
messages = MessageBus.track_publish do
|
||||
topic.make_banner!(user)
|
||||
topic.archetype.should == Archetype.banner
|
||||
end
|
||||
|
||||
channels = messages.map(&:channel)
|
||||
channels.should include('/site/banner')
|
||||
channels.should include('/distributed_hash')
|
||||
end
|
||||
|
||||
it "ensures only one banner topic at all time" do
|
||||
banner_topic = Fabricate(:banner_topic)
|
||||
_banner_topic = Fabricate(:banner_topic)
|
||||
Topic.where(archetype: Archetype.banner).count.should == 1
|
||||
|
||||
topic.make_banner!(user)
|
||||
|
Loading…
x
Reference in New Issue
Block a user