OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add specs for embedded and linked entity
Klaus Zandersf2539856478a
diff --git a/spec/lib/api/v3/shares/share_representer_rendering_spec.rb b/spec/lib/api/v3/shares/share_representer_rendering_spec.rbindex cf0b5d7ca4c..c3a9b578e03 100644--- a/spec/lib/api/v3/shares/share_representer_rendering_spec.rb+++ b/spec/lib/api/v3/shares/share_representer_rendering_spec.rb@@ -82,6 +82,14 @@ RSpec.describe API::V3::Shares::ShareRepresenter, 'rendering' doendend+ describe 'entity' do+ it_behaves_like 'has a titled link' do+ let(:link) { 'entity' }+ let(:href) { api_v3_paths.work_package(work_package.id) }+ let(:title) { work_package.subject }+ end+ end+describe 'project' doit_behaves_like 'has a titled link' dolet(:link) { 'project' }@@ -156,6 +164,26 @@ RSpec.describe API::V3::Shares::ShareRepresenter, 'rendering' doenddescribe '_embedded' do+ describe 'entity' do+ let(:embedded_path) { '_embedded/entity' }++ context 'for a work package' do+ it 'has the work package embedded' do+ expect(subject)+ .to be_json_eql('WorkPackage'.to_json)+ .at_path("#{embedded_path}/_type")++ expect(subject)+ .to be_json_eql(work_package.subject.to_json)+ .at_path("#{embedded_path}/subject")++ expect(subject)+ .to be_json_eql(work_package.id.to_json)+ .at_path("#{embedded_path}/id")+ end+ end+ end+describe 'project' dolet(:embedded_path) { '_embedded/project' }@@ -168,15 +196,6 @@ RSpec.describe API::V3::Shares::ShareRepresenter, 'rendering' do.to be_json_eql(project.name.to_json).at_path("#{embedded_path}/name")end-- context 'for a global member' do- let(:project) { nil }-- it 'has no project embedded' do- expect(subject)- .not_to have_json_path(embedded_path)- end- endenddescribe 'principal' do