title: In RSpec, using let variable inside before :all block
body: <p>I have the following code inside most of my tests:</p>
  
  <pre><code>describe 'index'
   let(:company) { FactoryGirl.create(:company) }
   let(:user) { FactoryGirl.create(:user, company: company) }
  
   before do
     sign_in user
     visit products_path
   end
  ...
  end
  </code></pre>
  
  <p>But I'm getting the following warning:</p>
  
  <pre><code>WARNING: let declaration 'user' accessed in a 'before(:all)'
  </code></pre>
  
  <p>My question is, what is the correct way of doing this? I can't find much information about the warning itself.</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT:</strong> My goal is to use the user variable so I can pass it on to sign_in, which signs the user in, and use it later on another tests (I check for the company attribute of the User)</p>