diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb index 1c295d588f..25524b1ca9 100644 --- a/lib/api/v3/work_packages/work_package_representer.rb +++ b/lib/api/v3/work_packages/work_package_representer.rb @@ -230,9 +230,9 @@ module API property :due_date, getter: -> (*) { due_date.to_datetime.utc.iso8601 unless due_date.nil? }, render_nil: true property :estimated_time, getter: -> (*) { - { units: I18n.t(:'datetime.units.hour', count: estimated_hours.to_i), - value: estimated_hours } - }, + { units: I18n.t(:'datetime.units.hour', count: estimated_hours.to_i), + value: estimated_hours } + }, setter: -> (value, *) { self.estimated_hours = ActiveSupport::JSON.decode(value)['value'] }, render_nil: true property :percentage_done, diff --git a/spec/requests/api/v3/work_package_resource_spec.rb b/spec/requests/api/v3/work_package_resource_spec.rb index f758eaec7c..f47f6f5da1 100644 --- a/spec/requests/api/v3/work_package_resource_spec.rb +++ b/spec/requests/api/v3/work_package_resource_spec.rb @@ -351,10 +351,12 @@ h4. things we like context 'project id' do let(:another_project) { FactoryGirl.create(:project) } - let!(:another_membership) { FactoryGirl.create(:member, - user: current_user, - project: another_project, - roles: [role]) } + let!(:another_membership) { + FactoryGirl.create(:member, + user: current_user, + project: another_project, + roles: [role]) + } let(:params) { valid_params.merge(projectId: another_project.id) } include_context 'patch request'