I recall there being a way to execute a step from within another step using spinach.
As I recall, such a step would appear similar to the following:
...
step "I create a patient as a facility's administrator" do
%Q{ Given I am a facility's administrator }
%Q{ Given I create a patient }
end
...
Found .execute(step) but haven't had any luck getting at a Step object to send as argument. How can I execute steps from within another step? Help is appreciated.
executeis an internal method that shouldn't be used from a feature. If you want to execute a step from another step you do have to underscore it. Spinach maintainers suggest extracting the logic in "I am a facility's administrator" and "I create a patient" step to another method, and calling this very method from other steps.source: https://github.com/codegram/spinach/issues/132