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.
execute
is 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.
step "I create a patient as a facility's administrator" do
log_as_facility_admin
create_patient
end
def log_as_facility_admin
# something
end
def create_patient
# something
end