こう書けます
# spec/support/user_helper.rb
module UserHelper
module Features
def help_foo
end
def help_bar
end
def help_baz
end
end
module Requests
def help_bar
end
end
end
RSpec.configure do |config|
config.include UserHelper::Features, type: :feature
config.include UserHelper::Requests, type: :request
end
テストを支援するgemを入れると(例えばfactory_girl)
RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
end
spec/rails_helper.rbのconfigureブロックで、ヘルパーモジュールをincludeするので
テストで使うモジュールは全てここでincludeしないといけないのかなと思ってましたが
そんな事はなく、ヘルパーモジュール本体からincludeできます。