Can someone provide an example of how to use FitNesse String Fixture?
The following doesn't work:
|fitnesse.fixtures.StringFixture|
|value|expected|contains? |
|hello|lo |true |
To provide context I'm trying to verify the value of the Id field of a output of a REST call:
|Table:smartrics.rest.fitnesse.fixture.RestFixture | http://localhost|
|GET|/data/1234| | | |
|let|body |js| JSON.parse(response.body) | |
|let|id |js| JSON.parse(response.body).Data[0].Id | |
And I'd like not to write any code for this at all if possible.
I don't know about the fixtures you refer to, but you can do what you describe with my fixtures (https://github.com/fhoeben/hsac-fitnesse-fixtures).
For strings: nl.hsac.fitnesse.fixture.slim.StringFixture
For JSON (which uses JsonPath): nl.hsac.fitnesse.fixture.slim.JsonHttpTest
So your REST check would be something like: