title: Testing rails controller with rspec: value is same, but object id is different
body: <p>I try to test a rails controller with rspec like this:</p>
  
  <pre><code>require 'spec_helper'
  
  describe NewsController do  
    describe "GET 'edit'" do
      before(:each) do
        @news_1 = FactoryGirl.create(:news_1)
        get :edit, { :id =&gt; @news_1.id }
      end
      it { response.should be_success }
      it { assigns(:news).should eq(@news_1) }
      it { response.should render_template(:edit) }
    end
  end
  </code></pre>
  
  <p>But, I got this error.</p>
  
  <pre><code>    Failures:
  
    1) NewsController GET 'edit' 
       Failure/Error: it { assigns(:news).should eq(@news_1) }
  
         expected: #&lt;News id: 1, title: "news_title_1", contents: "news_contents_1", display: nil, created_at: "2012-11-29 07:24:49", updated_at: "2012-11-29 07:24:49", news_date: nil, orion: false, pw: false, op: false, pickup: false, info_1: nil, info_2: nil, info_3: nil, info_4: nil, info_5: nil, del: false, place: nil, contact: false&gt;
              got: #&lt;News id: 1, title: "news_title_1", contents: "news_contents_1", display: nil, created_at: "2012-11-29 07:24:49", updated_at: "2012-11-29 07:24:49", news_date: nil, orion: false, pw: false, op: false, pickup: false, info_1: nil, info_2: nil, info_3: nil, info_4: nil, info_5: nil, del: false, place: nil, contact: false&gt;
  
         (compared using ==)
  
         Diff:#&lt;News:0x000001030b55c8&gt;.==(#&lt;News:0x000001033126b8&gt;) returned false even though the diff between #&lt;News:0x000001030b55c8&gt; and #&lt;News:0x000001033126b8&gt; is empty. Check the implementation of #&lt;News:0x000001030b55c8&gt;.==.
       # ./spec/controllers/news_controller_spec.rb:73:in `block (3 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p>I think these values are same, but object id is different.
  So this test fails... 
  How do I solve this error?</p>