mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: add ReadOnly hear to /srv/status
This commit is contained in:
22
spec/requests/forums_controller_spec.rb
Normal file
22
spec/requests/forums_controller_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user