2019-05-03 06:21:07 -04:00
|
|
|
# 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
|
2019-06-21 10:08:57 -04:00
|
|
|
Discourse.received_postgres_readonly!
|
2019-05-03 06:21:07 -04:00
|
|
|
get "/srv/status"
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(response.headers['Discourse-Readonly']).to eq('true')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|