Allow ReadOnly to propogate up to the Ember app via Response Header

This commit is contained in:
Robin Ward
2015-04-24 14:32:18 -04:00
parent 5b3f99aa50
commit 3a6efa25f0
8 changed files with 58 additions and 16 deletions

View File

@ -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