discourse/spec/requests/forums_controller_spec.rb
David Taylor afb5ec811d FIX: Don't use DistributedCache to store redis readonly state
This can cause unbound CPU usage in some cases, and excessive logging in other cases. This commit moves redis readonly information into the local process, but maintains the DistributedCache for postgres readonly state.
2019-06-25 11:20:34 +08:00

23 lines
571 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe ForumsController do
describe "read only header" do
it "returns no read only header by default" do
get "/srv/status"
expect(response.status).to eq(200)
expect(response.headers['Discourse-Readonly']).to eq(nil)
end
it "returns a readonly header if the site is read only" do
Discourse.received_postgres_readonly!
get "/srv/status"
expect(response.status).to eq(200)
expect(response.headers['Discourse-Readonly']).to eq('true')
end
end
end