Skip to content

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

baseline api: adding spec for backwards compatibility

Sebastian Fiedlschuster18dbf27139bb
diff --git a/spec/requests/api/v3/work_packages/index_resource_spec.rb b/spec/requests/api/v3/work_packages/index_resource_spec.rb
index bb317248d51..762a34dfde2 100644
--- a/spec/requests/api/v3/work_packages/index_resource_spec.rb
+++ b/spec/requests/api/v3/work_packages/index_resource_spec.rb
@@ -651,6 +651,30 @@ describe 'API v3 Work package resource',
end
end
end
+
+ describe "when providing only the current timestamp PT0S, which is equivalent to providing no timestamps" do
+ let(:timestamps) { [Timestamp.now] }
+
+ it "has the attributes in the main object" do
+ expect(subject.body)
+ .to be_json_eql(work_package.subject.to_json)
+ .at_path('_embedded/elements/0/subject')
+ end
+
+ it "has no _meta" do
+ expect(subject.body)
+ .not_to have_json_path('_embedded/elements/0/_meta/matchesFilters')
+ expect(subject.body)
+ .not_to have_json_path('_embedded/elements/0/_meta/exists')
+ expect(subject.body)
+ .not_to have_json_path('_embedded/elements/0/_meta/timestamp')
+ end
+
+ it "has no attributesByTimestamp" do
+ expect(subject.body)
+ .not_to have_json_path('_embedded/elements/0/_embedded/attributesByTimestamp')
+ end
+ end
end
end
end