A platform for community discussion. Free, open, simple.
DEV: Fix missing optional site.json fields (#17364)
Blake Erickson59d514df3427
diff --git a/spec/requests/api/schemas/json/site_response.json b/spec/requests/api/schemas/json/site_response.jsonindex 62055ef4b51..4b5c4af24c0 100644--- a/spec/requests/api/schemas/json/site_response.json+++ b/spec/requests/api/schemas/json/site_response.json@@ -634,6 +634,16 @@},"can_edit": {"type": "boolean"+ },+ "custom_fields": {+ "type": [+ "object",+ "null"+ ],+ "additionalProperties": true+ },+ "parent_category_id": {+ "type": "integer"}},"required": [diff --git a/spec/requests/api/site_spec.rb b/spec/requests/api/site_spec.rbindex ee8016f5189..9d026b5dfbb 100644--- a/spec/requests/api/site_spec.rb+++ b/spec/requests/api/site_spec.rb@@ -3,7 +3,9 @@ require 'swagger_helper'describe 'site' do- let(:admin) { Fabricate(:admin) }+ fab!(:admin) { Fabricate(:admin) }+ fab!(:category) { Fabricate(:category) }+ fab!(:subcategory) { Fabricate(:category, parent_category: category) }before doJobs.run_immediately!@@ -21,12 +23,18 @@ describe 'site' doproduces 'application/json'response '200', 'success response' do- expected_response_schema = load_spec_schema('site_response')- schema expected_response_schema+ begin+ Site.preloaded_category_custom_fields << "no_oddjob"- it_behaves_like "a JSON endpoint", 200 do- let(:expected_response_schema) { expected_response_schema }- let(:expected_request_schema) { expected_request_schema }+ expected_response_schema = load_spec_schema('site_response')+ schema expected_response_schema++ it_behaves_like "a JSON endpoint", 200 do+ let(:expected_response_schema) { expected_response_schema }+ let(:expected_request_schema) { expected_request_schema }+ end+ ensure+ Site.preloaded_category_custom_fields = Set.newendendend