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

Merge remote-tracking branch 'origin/dev' into bim/feature/bcf_api_topics_create

ulferts0e57d7226237
diff --cc modules/bcf/spec/requests/api/bcf/v2_1/shared_responses.rb
index e0f98f0258c,b031733de52..5db1743e6e2
--- a/modules/bcf/spec/requests/api/bcf/v2_1/shared_responses.rb
+++ b/modules/bcf/spec/requests/api/bcf/v2_1/shared_responses.rb
@@@ -27,19 -27,20 +27,21 @@@
#++
shared_examples_for 'bcf api successful response' do
- it 'has a successful status' do
+ it 'responds correctly with the expected body', :aggregate_failures do
- expect(subject.status).to eq 200
+ expect(subject.status)
+ .to eql(defined?(expected_status) ? expected_status : 200)
+ expect(subject.body).to be_json_eql(expected_body.to_json)
+ expect(subject.headers['Content-Type']).to eql 'application/json; charset=utf-8'
end
+ end
- it 'returns the resource' do
- expect(subject.body)
- .to be_json_eql(expected_body.to_json)
- end
+ shared_examples_for 'bcf api successful response expectation' do
+ it 'responds correctly with the expected body', :aggregate_failures do
+ expect(subject.status).to eq 200
- it 'is has a json content type header' do
- expect(subject.headers['Content-Type'])
- .to eql 'application/json; charset=utf-8'
+ instance_exec(subject.body, &expectations)
+
+ expect(subject.headers['Content-Type']).to eql 'application/json; charset=utf-8'
end
end