From b50bad471671fc2b85bb254ee69dfe908bd2b21f Mon Sep 17 00:00:00 2001 From: Jan Sandbrink Date: Mon, 2 Feb 2015 15:55:48 +0100 Subject: [PATCH] include dates in schema --- .../form/work_package_schema_representer.rb | 6 ++++++ .../form/work_package_schema_representer_spec.rb | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/api/v3/work_packages/form/work_package_schema_representer.rb b/lib/api/v3/work_packages/form/work_package_schema_representer.rb index 174b2d759b..cf57fbad68 100644 --- a/lib/api/v3/work_packages/form/work_package_schema_representer.rb +++ b/lib/api/v3/work_packages/form/work_package_schema_representer.rb @@ -47,6 +47,12 @@ module API property :description, getter: -> (*) { { type: 'Formattable' } }, writeable: false + property :startDate, + getter: -> (*) { { type: 'Date' } }, + writeable: false + property :dueDate, + getter: -> (*) { { type: 'Date' } }, + writeable: false property :status, exec_context: :decorator, getter: -> (*) { diff --git a/spec/lib/api/v3/work_packages/form/work_package_schema_representer_spec.rb b/spec/lib/api/v3/work_packages/form/work_package_schema_representer_spec.rb index 6f107290b6..4008dc76e8 100644 --- a/spec/lib/api/v3/work_packages/form/work_package_schema_representer_spec.rb +++ b/spec/lib/api/v3/work_packages/form/work_package_schema_representer_spec.rb @@ -93,6 +93,18 @@ describe ::API::V3::WorkPackages::Form::WorkPackageSchemaRepresenter do it_behaves_like 'schema property', 'subject', 'String' end + describe 'description' do + it_behaves_like 'schema property', 'description', 'Formattable' + end + + describe 'startDate' do + it_behaves_like 'schema property', 'startDate', 'Date' + end + + describe 'dueDate' do + it_behaves_like 'schema property', 'dueDate', 'Date' + end + describe 'status' do shared_examples_for 'contains statuses' do it_behaves_like 'linked property', 'status', 'Status'