Skip to content

Instantly share code, notes, and snippets.

Embed
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
end
# 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
You can’t perform that action at this time.