Open sandeepnagra opened 7 years ago
Temporarily, I have created following custom step:
When(/^I set request body to "(.*?)"$/) do |value| @body = value end
and then the following scenario works:
Scenario: Try to set keep data value under database settings with response code 200 Given I send "text/plain" and accept JSON And I set request body to "90" When I send a PUT request to "http://hostname:8080/settings/databaseSettings/dataRetention" Then the response status should be "200"
That would be my approach for this as well. Make a PR, probably adding a sample and I'll merge it!
I tried something like:
Scenario: Try to set keep data value under database settings with response code 200 Given I send "text/plain" and accept JSON When I send a PUT request to "http://hostname:8080/settings/databaseSettings/dataRetention" with: | 90 | Then the response status should be "200"
But it fails. I have always used JSON request body, this is the first REST API which needs plain text and I am trying to figure out how to do it.