hidroh / cucumber-api

API validator in BBD style with Cucumber
https://rubygems.org/gems/cucumber-api
Apache License 2.0
52 stars 56 forks source link

Default header values #16

Open jskirst opened 7 years ago

jskirst commented 7 years ago

Headers a reset after each request, which makes sense, but in most API calls header values are always the same (like a basic auth header or content type). It would significantly DRY up tests to allow for default headers to get set that bypass the need to say "I send and accept JSON" and other header settings.

jskirst commented 7 years ago

I'm going to open a PR for this shortly.

biggianteye commented 6 years ago

I do this by making use of Background, which is applied to all scenarios in the Feature.

This PR shows an example: https://github.com/hidroh/cucumber-api/pull/26