Skip to content

Instantly share code, notes, and snippets.

@lujanfernaud
Last active May 8, 2020 06:25
Show Gist options
  • Select an option

  • Save lujanfernaud/077933beb557d63a7f2e1b40610405cf to your computer and use it in GitHub Desktop.

Select an option

Save lujanfernaud/077933beb557d63a7f2e1b40610405cf to your computer and use it in GitHub Desktop.
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