Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
RSpec: Include based on type

RSpec: Include based on type

# spec/support/user_support.rb
RSpec.configure do |config|
 config.include UserHelper, type: :user
 config.include_context "user_context", type: :use
# spec/user_something.rb
describe User, type: :user do
  # The includes will not be needed here anymore.
  # include UserHelper
  # include_context "user_context"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment