title: Rails, Restful Authentication & RSpec - How to test new models that require authentication
body: <p>I've created a learning application using <a href="http://jimneath.org/2008/09/09/bort-base-rails-application/" rel="noreferrer">Bort</a>, which is a base app that includes Restful Authentication and RSpec.  I've got it up and running and added a new object that requires users to be logged in before they can do anything(<code>before_filter :login_required</code> in the controller).  [edit: I should also mention that the user <code>has_many</code> of the new class and only the user should be able to see it.]</p>
  
  <p>I've created the new model/controller using Rspec's generators which have created a number of default tests.  They all pass if there is no <code>before_filter</code> but several fail, as should be expected, once the <code>before_filter</code> is in place.</p>
  
  <p>How do I get the generated tests to run as if there is/is not a logged in user?  Do I need a whole batch of matching not logged in - redirect tests?  I assume it is some sort of mocking or fixture technique but I am new to RSpec and a bit adrift.  Good RSpec tutorial links would also be appreciated.</p>