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

[#64530] Refactor: use receive_messages in project schema spec

Tobias Dillmann867b961cfdf9
diff --git a/spec/lib/api/v3/projects/schemas/project_schema_representer_spec.rb b/spec/lib/api/v3/projects/schemas/project_schema_representer_spec.rb
index 498d9cbdc85..16d36b0dbc2 100644
--- a/spec/lib/api/v3/projects/schemas/project_schema_representer_spec.rb
+++ b/spec/lib/api/v3/projects/schemas/project_schema_representer_spec.rb
@@ -54,26 +54,17 @@ RSpec.describe API::V3::Projects::Schemas::ProjectSchemaRepresenter do
writable.include?(attribute.to_s)
end
- allow(contract)
- .to receive(:available_custom_fields)
- .and_return([custom_field])
-
allow(contract)
.to receive(:assignable_values)
.with(:status_code, current_user)
.and_return(allowed_status)
allow(contract)
- .to receive(:model)
- .and_return(model)
+ .to receive_messages(available_custom_fields: [custom_field], model: model)
- allow(model)
- .to receive(:new_record?)
- .and_return(new_record)
allow(model)
- .to receive(:id)
- .and_return(model_id)
+ .to receive_messages(new_record?: new_record, id: model_id)
contract
end