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
more descriptive test output
Christophe Bliardb592d7cf0be6
diff --git a/spec/requests/api/v3/support/response_examples.rb b/spec/requests/api/v3/support/response_examples.rbindex 7ce92bedb8a..65ef5d07bfc 100644--- a/spec/requests/api/v3/support/response_examples.rb+++ b/spec/requests/api/v3/support/response_examples.rb@@ -33,7 +33,7 @@ shared_examples_for 'error response' do |code, id, provided_message = nil|provided_message || messageend- it 'has the expected status code' do+ it "has the status code #{code}" doexpect(last_response.status).to eq(code)end@@ -46,7 +46,9 @@ shared_examples_for 'error response' do |code, id, provided_message = nil|describe 'response body' dosubject { JSON.parse(last_response.body) }- it { expect(subject['errorIdentifier']).to eq("urn:openproject-org:api:v3:errors:#{id}") }+ describe 'errorIdentifier' do+ it { expect(subject['errorIdentifier']).to eq("urn:openproject-org:api:v3:errors:#{id}") }+ enddescribe 'message' doit { expect(subject['message']).to include(expected_message) }@@ -156,10 +158,14 @@ shared_examples_for 'read-only violation' do |attribute, model, attribute_messagit { expect(subject['attribute']).to eq(attribute) }end+ message = [+ attribute_message || model.human_attribute_name(attribute),+ I18n.t('activerecord.errors.messages.error_readonly')+ ].join(" ")it_behaves_like 'error response',422,'PropertyIsReadOnly',- "#{attribute_message || model.human_attribute_name(attribute)} #{I18n.t('activerecord.errors.messages.error_readonly')}"+ messageendshared_examples_for 'multiple errors' do |code, _message|