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
[#38833] Fixed PR issues
Eric Schubert78c4531d1c1c
diff --git a/modules/bim/app/controllers/bim/bcf/api/v2_1/comments/api.rb b/modules/bim/app/controllers/bim/bcf/api/v2_1/comments/api.rbindex 0091dce9bdd..04a613bacf2 100644--- a/modules/bim/app/controllers/bim/bcf/api/v2_1/comments/api.rb+++ b/modules/bim/app/controllers/bim/bcf/api/v2_1/comments/api.rb@@ -75,9 +75,13 @@ module Bim::Bcf::API::V2_1params_modifier: ->(params) { transform_create_parameter(params).merge(params) }).mount+ params do+ requires :comment_guid, type: String, desc: 'The comment\'s UUID'+ end+route_param :comment_guid, regexp: /\A[a-f0-9\-]+\z/ doafter_validation do- @comment = all_comments.find_by!(uuid: params[:comment_guid])+ @comment = all_comments.find_by!(uuid: declared_params[:comment_guid])endget &::Bim::Bcf::API::V2_1::Endpoints::Show.new(model: Bim::Bcf::Comment).mountdiff --git a/modules/bim/app/models/bim/bcf/non_existent_comment.rb b/modules/bim/app/models/bim/bcf/non_existent_comment.rbindex c80cf89b04f..edbd51c3fcb 100644--- a/modules/bim/app/models/bim/bcf/non_existent_comment.rb+++ b/modules/bim/app/models/bim/bcf/non_existent_comment.rb@@ -1,4 +1,7 @@module Bim::Bcfclass NonExistentComment < Comment+ def readonly?+ true+ endendenddiff --git a/modules/bim/app/models/bim/bcf/non_existent_viewpoint.rb b/modules/bim/app/models/bim/bcf/non_existent_viewpoint.rbindex 338bf97274c..ceaa0d15c26 100644--- a/modules/bim/app/models/bim/bcf/non_existent_viewpoint.rb+++ b/modules/bim/app/models/bim/bcf/non_existent_viewpoint.rb@@ -1,4 +1,7 @@module Bim::Bcfclass NonExistentViewpoint < Viewpoint+ def readonly?+ true+ endendenddiff --git a/modules/bim/spec/requests/api/bcf/v2_1/comments_api_spec.rb b/modules/bim/spec/requests/api/bcf/v2_1/comments_api_spec.rbindex 4a292742dc0..4b6eb3329ea 100644--- a/modules/bim/spec/requests/api/bcf/v2_1/comments_api_spec.rb+++ b/modules/bim/spec/requests/api/bcf/v2_1/comments_api_spec.rb@@ -56,7 +56,7 @@ describe 'BCF 2.1 comments resource', type: :request, content_type: :json, with_let(:assignee) { FactoryBot.create(:user) }let(:work_package) do- FactoryBot.create(:work_package, assigned_to: assignee, due_date: Date.today, project: project)+ FactoryBot.create(:work_package, assigned_to: assignee, due_date: Time.zone.today, project: project)endlet(:bcf_issue) { FactoryBot.create(:bcf_issue_with_viewpoint, work_package: work_package) }@@ -592,7 +592,6 @@ describe 'BCF 2.1 comments resource', type: :request, content_type: :json, with_}endend-endenddiff --git a/modules/bim/spec/requests/api/bcf/v2_1/shared_responses.rb b/modules/bim/spec/requests/api/bcf/v2_1/shared_responses.rbindex 9265f1e305d..677c8fd44bb 100644--- a/modules/bim/spec/requests/api/bcf/v2_1/shared_responses.rb+++ b/modules/bim/spec/requests/api/bcf/v2_1/shared_responses.rb@@ -64,7 +64,7 @@ shared_examples_for 'bcf api successful response' do.to eql(defined?(expected_status) ? expected_status : 200)if expected_body.nil?- expect("").to be_json_eql(expected_body.to_json)+ expect(subject.body).to be_json_eql(expected_body.to_json)elseexpect_identical_without_time(subject, expected_body)end@@ -84,47 +84,47 @@ shared_examples_for 'bcf api successful response expectation' doendshared_examples_for 'bcf api not found response' do- let(:expect_404) do+ let(:expect404) do{ message: 'The requested resource could not be found.' }endit 'responds 404 NOT FOUND', :aggregate_failures doexpect(subject.status).to eq 404- expect(subject.body).to be_json_eql(expect_404.to_json)+ expect(subject.body).to be_json_eql(expect404.to_json)expect(subject.headers['Content-Type']).to eql 'application/json; charset=utf-8'endendshared_examples_for 'bcf api method not allowed response' do- let(:expect_405) { "405 Not Allowed" }+ let(:expect405) { "405 Not Allowed" }it 'responds 405 METHOD NOT ALLOWED', :aggregate_failures doexpect(subject.status).to eq 405- expect(subject.body).to eql(expect_405)+ expect(subject.body).to eql(expect405)expect(subject.headers['Content-Type']).to eql 'application/json; charset=utf-8'endendshared_examples_for 'bcf api not allowed response' do- let(:expect_403) do+ let(:expect403) do{ message: 'You are not authorized to access this resource.' }endit 'responds 403 NOT ALLOWED', :aggregate_failures doexpect(subject.status).to eq 403- expect(subject.body).to be_json_eql(expect_403.to_json)+ expect(subject.body).to be_json_eql(expect403.to_json)expect(subject.headers['Content-Type']).to eql 'application/json; charset=utf-8'endendshared_examples_for 'bcf api unprocessable response' do- let(:expect_422) do+ let(:expect422) do{ message: message }endit 'responds 422 UNPROCESSABLE ENTITY', :aggregate_failures doexpect(subject.status).to eq 422- expect(subject.body).to be_json_eql(expect_422.to_json)+ expect(subject.body).to be_json_eql(expect422.to_json)expect(subject.headers['Content-Type']).to eql 'application/json; charset=utf-8'endend