mirror of
https://github.com/discourse/discourse.git
synced 2025-02-10 21:34:50 +00:00
* Remove outdated option
04078317ba
* Use the non-globally exposed RSpec syntax
https://github.com/rspec/rspec-core/pull/2803
* Use the non-globally exposed RSpec syntax, cont
https://github.com/rspec/rspec-core/pull/2803
* Comply to strict predicate matchers
See:
- https://github.com/rspec/rspec-expectations/pull/1195
- https://github.com/rspec/rspec-expectations/pull/1196
- https://github.com/rspec/rspec-expectations/pull/1277
40 lines
1.2 KiB
Ruby
40 lines
1.2 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "shared_context_for_backup_restore"
|
|
|
|
RSpec.describe BackupRestore::SystemInterface, type: :multisite do
|
|
include_context "shared stuff"
|
|
|
|
subject { BackupRestore::SystemInterface.new(logger) }
|
|
|
|
describe "#flush_redis" do
|
|
it "removes only keys from the current site in a multisite" do
|
|
test_multisite_connection("default") do
|
|
Discourse.redis.set("foo", "default-foo")
|
|
Discourse.redis.set("bar", "default-bar")
|
|
|
|
expect(Discourse.redis.get("foo")).to eq("default-foo")
|
|
expect(Discourse.redis.get("bar")).to eq("default-bar")
|
|
end
|
|
|
|
test_multisite_connection("second") do
|
|
Discourse.redis.set("foo", "second-foo")
|
|
Discourse.redis.set("bar", "second-bar")
|
|
|
|
expect(Discourse.redis.get("foo")).to eq("second-foo")
|
|
expect(Discourse.redis.get("bar")).to eq("second-bar")
|
|
|
|
subject.flush_redis
|
|
|
|
expect(Discourse.redis.get("foo")).to be_nil
|
|
expect(Discourse.redis.get("bar")).to be_nil
|
|
end
|
|
|
|
test_multisite_connection("default") do
|
|
expect(Discourse.redis.get("foo")).to eq("default-foo")
|
|
expect(Discourse.redis.get("bar")).to eq("default-bar")
|
|
end
|
|
end
|
|
end
|
|
end
|