Tim Cooke wrote:Cucumber tests usually have a slightly larger scope when it comes to defining your unit of test. What you describe there would be more like a unit test that you might have written within that module, whereas what you're describing is a behaviour test observed from outside the module.
Consider writing your test to interact with the service only through the API and identify a desired observed behaviour. For example: You make a service call that returns a response that is based on some state value within the service. You then make a service call that alters that state (writes to the database). Then make a second call to the first service and verify that the response has changed according to the change in state. That way you are verifying the behaviour of the service through its published API without having to depend on its implementation details such as the database.
, where would this behaviour occur?
desired observed behaviour