mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: Clear anon cache when clearing recently readonly.
This commit is contained in:
parent
3359b3baca
commit
b0adffdef5
2 changed files with 16 additions and 0 deletions
|
@ -238,6 +238,20 @@ describe Discourse do
|
|||
expect(Discourse.last_read_only['default']).to eq(time)
|
||||
end
|
||||
end
|
||||
|
||||
describe ".clear_readonly!" do
|
||||
it "publishes the right message" do
|
||||
Discourse.received_readonly!
|
||||
messages = []
|
||||
|
||||
expect do
|
||||
messages = MessageBus.track_publish { Discourse.clear_readonly! }
|
||||
end.to change { Discourse.last_read_only['default'] }.to(nil)
|
||||
|
||||
expect(messages.any? { |m| m.channel == Site::SITE_JSON_CHANNEL })
|
||||
.to eq(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "#handle_exception" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue