title: undefined method `sign_in' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x1057fd428> error while trying to set up RSpec with Devise
body: <p>I've got a <code>spec/controllers/add_to_carts_spec.rb</code>:</p>
  
  <pre><code>require 'spec_helper'
  
  describe CartItemsController do
  
    before (:each) do
      @user = Factory(:user)
      sign_in @user
    end
  
    describe "add stuff to the cart" do
      it "should add a product to the cart" do
        product = FactoryGirl.create(:product)
        visit products_path(product)
        save_and_open_page
        click_on('cart_item_submit')
      end
    end
  
  end
  </code></pre>
  
  <p>and <code>/spec/support/spec_helper.rb</code>:</p>
  
  <pre><code># This file is copied to spec/ when you run 'rails generate rspec:install'
  ENV["RAILS_ENV"] ||= 'test'
  require File.expand_path("../../config/environment", __FILE__)
  require 'rspec/rails'
  require 'capybara/rspec'
  
  # Requires supporting ruby files with custom matchers and macros, etc,
  # in spec/support/ and its subdirectories.
  Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
  
  RSpec.configure do |config|
    config.mock_with :rspec
    config.use_transactional_fixtures = true
  end
  </code></pre>
  
  <p>... which also loads <code>/spec/support/devise.rb</code>:</p>
  
  <pre><code>RSpec.configure do |config|
    config.include Devise::TestHelpers, :type =&gt; :controller
  end
  </code></pre>
  
  <p>Guard is running in the background and keeps throwing this:</p>
  
  <pre><code>Failures:
  
    1) CartItemsController add stuff to the cart should add a product to the cart
       Failure/Error: sign_in @user
       NoMethodError:
         undefined method `sign_in' for #&lt;RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x1057fd428&gt;
       # ./spec/controllers/add_to_carts_spec.rb:7
  </code></pre>
  
  <p>I've spent the last couple hours trying various config adjustments and different syntaxes but nothing seems to change. Any ideas?</p>
  
  <p>(edited to reflect newer error)</p>