mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 18:00:39 -06:00
776b4ec8e2
We're now using the new, database-backed problem check system. This PR removes parts of the old, Redis-backed system that is now defunct.
37 lines
971 B
Ruby
37 lines
971 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe AdminDashboardData do
|
|
after do
|
|
AdminDashboardData.reset_problem_checks
|
|
Discourse.redis.flushdb
|
|
end
|
|
|
|
describe "stats cache" do
|
|
include_examples "stats cacheable"
|
|
end
|
|
|
|
describe "#problem_message_check" do
|
|
let(:key) { "new_key" }
|
|
|
|
after { described_class.clear_problem_message(key) }
|
|
|
|
it "returns nil if message has not been added" do
|
|
expect(described_class.problem_message_check(key)).to be_nil
|
|
end
|
|
|
|
it "returns a message if it was added" do
|
|
described_class.add_problem_message(key)
|
|
expect(described_class.problem_message_check(key)).to eq(
|
|
I18n.t(key, base_path: Discourse.base_path),
|
|
)
|
|
end
|
|
|
|
it "returns a message if it was added with an expiry" do
|
|
described_class.add_problem_message(key, 300)
|
|
expect(described_class.problem_message_check(key)).to eq(
|
|
I18n.t(key, base_path: Discourse.base_path),
|
|
)
|
|
end
|
|
end
|
|
end
|