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

Add spec that errors object differs

Oliver Güntheredfe2fe68c8e
diff --git a/spec/services/service_result_spec.rb b/spec/services/service_result_spec.rb
index 7775103d259..42eff0f4e67 100644
--- a/spec/services/service_result_spec.rb
+++ b/spec/services/service_result_spec.rb
@@ -82,6 +82,15 @@ describe ServiceResult, type: :model do
it 'is an empty ActiveModel::Errors by default' do
expect(instance.errors).to be_a ActiveModel::Errors
end
+
+ context 'providing errors from user' do
+ let(:result) { FactoryBot.build :work_package }
+
+ it 'creates a new errors instance' do
+ instance = ServiceResult.new result: result
+ expect(instance.errors).not_to eq result.errors
+ end
+ end
end
describe 'result' do