mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
MessageBus handles readonly redis now, no need to wrap it
This commit is contained in:
@@ -89,7 +89,7 @@ describe Discourse do
|
||||
|
||||
it "adds a key in redis and publish a message through the message bus" do
|
||||
$redis.expects(:set).with(Discourse.readonly_mode_key, 1)
|
||||
DiscourseBus.expects(:publish).with(Discourse.readonly_channel, true)
|
||||
MessageBus.expects(:publish).with(Discourse.readonly_channel, true)
|
||||
Discourse.enable_readonly_mode
|
||||
end
|
||||
|
||||
@@ -99,7 +99,7 @@ describe Discourse do
|
||||
|
||||
it "removes a key from redis and publish a message through the message bus" do
|
||||
$redis.expects(:del).with(Discourse.readonly_mode_key)
|
||||
DiscourseBus.expects(:publish).with(Discourse.readonly_channel, false)
|
||||
MessageBus.expects(:publish).with(Discourse.readonly_channel, false)
|
||||
Discourse.disable_readonly_mode
|
||||
end
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ describe PostCreator do
|
||||
|
||||
it "does not notify on system messages" do
|
||||
admin = Fabricate(:admin)
|
||||
messages = DiscourseBus.track_publish do
|
||||
messages = MessageBus.track_publish do
|
||||
p = PostCreator.create(admin, basic_topic_params.merge(post_type: Post.types[:moderator_action]))
|
||||
PostCreator.create(admin, basic_topic_params.merge(topic_id: p.topic_id, post_type: Post.types[:moderator_action]))
|
||||
end
|
||||
@@ -93,7 +93,7 @@ describe PostCreator do
|
||||
created_post = nil
|
||||
reply = nil
|
||||
|
||||
messages = DiscourseBus.track_publish do
|
||||
messages = MessageBus.track_publish do
|
||||
created_post = PostCreator.new(admin, basic_topic_params.merge(category: cat.id)).create
|
||||
reply = PostCreator.new(admin, raw: "this is my test reply 123 testing", topic_id: created_post.topic_id).create
|
||||
end
|
||||
@@ -118,7 +118,7 @@ describe PostCreator do
|
||||
it 'generates the correct messages for a normal topic' do
|
||||
|
||||
p = nil
|
||||
messages = DiscourseBus.track_publish do
|
||||
messages = MessageBus.track_publish do
|
||||
p = creator.create
|
||||
end
|
||||
|
||||
|
||||
@@ -573,7 +573,7 @@ describe Topic do
|
||||
describe "make_banner!" do
|
||||
|
||||
it "changes the topic archetype to 'banner'" do
|
||||
messages = DiscourseBus.track_publish do
|
||||
messages = MessageBus.track_publish do
|
||||
topic.make_banner!(user)
|
||||
expect(topic.archetype).to eq(Archetype.banner)
|
||||
end
|
||||
@@ -597,7 +597,7 @@ describe Topic do
|
||||
|
||||
it "resets the topic archetype" do
|
||||
topic.expects(:add_moderator_post)
|
||||
DiscourseBus.expects(:publish).with("/site/banner", nil)
|
||||
MessageBus.expects(:publish).with("/site/banner", nil)
|
||||
topic.remove_banner!(user)
|
||||
expect(topic.archetype).to eq(Archetype.default)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user