mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
Allow ReadOnly to propogate up to the Ember app via Response Header
This commit is contained in:
@ -107,6 +107,18 @@ describe TopicsController do
|
||||
end
|
||||
end
|
||||
|
||||
describe "read only header" do
|
||||
it "returns no read only header by default" do
|
||||
get :show, {topic_id: topic.id}
|
||||
expect(response.headers['Discourse-Readonly']).to eq(nil)
|
||||
end
|
||||
|
||||
it "returns a readonly header if the site is read only" do
|
||||
DiscourseRedis.received_readonly!
|
||||
get :show, {topic_id: topic.id}
|
||||
expect(response.headers['Discourse-Readonly']).to eq('true')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'api' do
|
||||
|
Reference in New Issue
Block a user