You should move this to a helper. You're going to be doing this all over.

```ruby
# spec/support/helpers/authentication_helpers.rb

module AuthenticationHelpers
  def sign_in_as(user)
    # your code to sign in a given user here
  end
end

# spec/spec_helper.rb
RSpec.configure do |config|
  include AuthenticationHelpers, type: :feature
end