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
adapt specs to altered non writable message
ulferts51e7f1f0483c
diff --git a/spec/models/mail_handler_spec.rb b/spec/models/mail_handler_spec.rbindex 74724e2399b..9855bef4f44 100644--- a/spec/models/mail_handler_spec.rb+++ b/spec/models/mail_handler_spec.rb@@ -276,18 +276,19 @@ describe MailHandler, type: :model doendit 'rejects if unknown_user=accept and permission check is present' do-expected ='MailHandler: work_package could not be created by Anonymous due to ' \- '#["may not be accessed.", "Type is not writable.", "Project is not writable.", ' \- '"Subject is not writable.", "Description is not writable."]'+ '#["may not be accessed.", "Type was attempted to be written but is not writable.", ' \+ '"Project was attempted to be written but is not writable.", ' \+ '"Subject was attempted to be written but is not writable.", ' \+ '"Description was attempted to be written but is not writable."]'expect(Rails.logger)- .to(receive(:error))+ .to receive(:error).with(expected)result = submit_email 'ticket_by_unknown_user.eml',- issue: {project: project.identifier},+ issue: { project: project.identifier },unknown_user: 'accept'expect(result).to eq false@@ -295,7 +296,7 @@ describe MailHandler, type: :model doit 'accepts if unknown_user=accept and no_permission_check' dowork_package = submit_email 'ticket_by_unknown_user.eml',- issue: {project: project.identifier},+ issue: { project: project.identifier },unknown_user: 'accept',no_permission_check: 1diff --git a/spec/requests/api/v3/relations/relations_api_spec.rb b/spec/requests/api/v3/relations/relations_api_spec.rbindex b572c5575b4..6e191ce9962 100644--- a/spec/requests/api/v3/relations/relations_api_spec.rb+++ b/spec/requests/api/v3/relations/relations_api_spec.rb@@ -302,7 +302,7 @@ describe 'API v3 Relation resource', type: :request, content_type: :json doit "should let the user know the attribute is read-only" domsg = JSON.parse(last_response.body)["message"]- expect(msg).to include 'read-only'+ expect(msg).to include "Work package an existing relation's `from` link is immutable"endendenddiff --git a/spec/requests/api/v3/support/response_examples.rb b/spec/requests/api/v3/support/response_examples.rbindex cda20d2cce2..d01b13c1f3b 100644--- a/spec/requests/api/v3/support/response_examples.rb+++ b/spec/requests/api/v3/support/response_examples.rb@@ -150,7 +150,7 @@ shared_examples_for 'format error' do |message|messageend-shared_examples_for 'read-only violation' do |attribute, model|+shared_examples_for 'read-only violation' do |attribute, model, attribute_message = nil|describe 'details' dosubject { JSON.parse(last_response.body)['_embedded']['details'] }@@ -160,7 +160,7 @@ shared_examples_for 'read-only violation' do |attribute, model|it_behaves_like 'error response',422,'PropertyIsReadOnly',- "#{model.human_attribute_name(attribute)} #{I18n.t('activerecord.errors.messages.error_readonly')}"+ "#{attribute_message || model.human_attribute_name(attribute)} #{I18n.t('activerecord.errors.messages.error_readonly')}"endshared_examples_for 'multiple errors' do |code, _message|diff --git a/spec/requests/api/v3/work_package_resource_spec.rb b/spec/requests/api/v3/work_package_resource_spec.rbindex c58eef42c16..69a5b4303b9 100644--- a/spec/requests/api/v3/work_package_resource_spec.rb+++ b/spec/requests/api/v3/work_package_resource_spec.rb@@ -856,13 +856,13 @@ describe 'API v3 Work package resource',context 'created_at' dolet(:params) { valid_params.merge(createdAt: tomorrow) }- it_behaves_like 'read-only violation', 'createdAt', WorkPackage+ it_behaves_like 'read-only violation', 'createdAt', WorkPackage, 'Created on'endcontext 'updated_at' dolet(:params) { valid_params.merge(updatedAt: tomorrow) }- it_behaves_like 'read-only violation', 'updatedAt', WorkPackage+ it_behaves_like 'read-only violation', 'updatedAt', WorkPackage, 'Updated on'endendend