mirror of
https://github.com/discourse/discourse.git
synced 2025-02-28 16:29:22 +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
35 lines
1.1 KiB
Ruby
35 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe SiteSettings::LocalProcessProvider, type: :multisite do
|
|
def expect_same_setting(actual, expected)
|
|
expect(actual.name).to eq(expected.name)
|
|
expect(actual.value).to eq(expected.value)
|
|
expect(actual.data_type).to eq(expected.data_type)
|
|
end
|
|
|
|
let(:provider) { described_class.new }
|
|
|
|
def setting(name, value, data_type)
|
|
described_class::Setting.new(name, data_type).tap { |s| s.value = value }
|
|
end
|
|
|
|
it "loads the correct settings" do
|
|
test_multisite_connection("default") { provider.save("test", "bla-default", 2) }
|
|
test_multisite_connection("second") { provider.save("test", "bla-second", 2) }
|
|
|
|
test_multisite_connection("default") do
|
|
expect_same_setting(provider.find("test"), setting("test", "bla-default", 2))
|
|
end
|
|
|
|
test_multisite_connection("second") do
|
|
expect_same_setting(provider.find("test"), setting("test", "bla-second", 2))
|
|
end
|
|
end
|
|
|
|
it "returns the correct site name" do
|
|
test_multisite_connection("second") do
|
|
expect(provider.current_site).to eq("second")
|
|
end
|
|
end
|
|
end
|