I usually put them in spec/support/spec_helpers . Then I include these modules in the relevant examples.
If you have some that are useful for all specifications of a certain type (for example, for all specifications of queries), you can do
config.include SomeHelper, :type => :request
which will include this module in all of your sample query groups.
Frederick cheung
source share