title: How to test instance variable was instantiated in controller with RSpec
body: <p>I'm trying to check that a new action in my RESTful controller set up an instance variable of the required Object type. Seems pretty typical, but having trouble executing it</p>
  
  <p><strong>Client Controller</strong></p>
  
  <pre><code>def new
    @client = Client.new
  end  
  </code></pre>
  
  <p><strong>Test</strong></p>
  
  <pre><code>describe "GET 'new'" do
    it "should be successful" do
      get 'new'
      response.should be_success
    end
  
    it "should create a new client" do
      get 'new'
      assigns(:client).should == Client.new
    end
  end
  </code></pre>
  
  <p><strong>Results in...</strong></p>
  
  <pre>
  'ClientsController GET 'new' should create a new client' FAILED
    expected: #,
         got: # (using ==)
  </pre>
  
  <p>Which is probably because it's trying to compare 2 instances of active record, which differ. So, how do I check that the controller set up an instance variable that holds a new instance of the Client model.</p>