diff --git a/spec/requests/api/schemas/json/site_response.json b/spec/requests/api/schemas/json/site_response.json index 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.rb index 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 do Jobs.run_immediately! @@ -21,12 +23,18 @@ describe 'site' do produces '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.new end end end