FIX: add ReadOnly hear to /srv/status

This commit is contained in:
Régis Hanol
2019-05-03 12:21:07 +02:00
parent 16ef060a76
commit 0d41d58d27
4 changed files with 44 additions and 8 deletions

View File

@@ -0,0 +1,22 @@
# 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_readonly!
get "/srv/status"
expect(response.status).to eq(200)
expect(response.headers['Discourse-Readonly']).to eq('true')
end
end
end