actually link the type from the WP

removing the name of the type which resided under "type"
this might break the current frontend
pull/2673/head
Jan Sandbrink 10 years ago
parent 832570bf3d
commit 266226880e
  1. 2
      lib/api/v3/work_packages/work_package_representer.rb
  2. 9
      spec/lib/api/v3/work_packages/work_package_representer_spec.rb

@ -102,6 +102,7 @@ module API
} if current_user_allowed_to(:move_work_packages)
end
linked_property :type
linked_property :status
linked_property :author, path: :user
@ -211,7 +212,6 @@ module API
property :id, render_nil: true
property :lock_version
property :subject, render_nil: true
property :type, getter: -> (*) { type.try(:name) }, render_nil: true
property :description,
exec_context: :decorator,
getter: -> (*) {

@ -125,7 +125,6 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter do
end
it { is_expected.to have_json_path('subject') }
it { is_expected.to have_json_path('type') }
describe 'lock version' do
it { is_expected.to have_json_path('lockVersion') }
@ -272,6 +271,14 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter do
end
end
describe 'type' do
it_behaves_like 'has a titled link' do
let(:link) { 'type' }
let(:href) { "/api/v3/types/#{work_package.type_id}" }
let(:title) { work_package.type.name }
end
end
describe 'author' do
it_behaves_like 'has a titled link' do
let(:link) { 'author' }

Loading…
Cancel
Save