title: Rails - Rspec: test PUT update to actually change Model attributes
body: <p>I have the following:</p>
  
  <pre><code>let(:update_request) { put "/api/v3/account/profile.json", attributes, credentials }
  
  describe "PUT 'update'" do
    before { update_request }
  
    context "updating normal attributes (no password)" do
      let(:attributes) {
        {
          profile: { first_name: 'John', phone: '02 21231321', email: 'aieie@brazorf.com' }
        }
      }
  
      it do
        aggregate_failures do
          # expect{response}.to change{current_user.reload.email}.to('aieie@brazorf.com')
          expect(response).to be_success
          expect(current_user.reload.first_name).to eq('John')
          expect(current_user.reload.phone).to eq('02 21231321')
          expect(current_user.reload.email).to eq('aieie@brazorf.com')
        end
      end
    end
  ...
  </code></pre>
  
  <p>The expectation that in the code above is commented out fails with the following message:</p>
  
  <blockquote>
    <p>Failure/Error: expect{response}.to change{current_user.reload.email}.to('aieie@brazorf.com')
           expected result to have changed to "aieie@brazorf.com", but did not change</p>
  </blockquote>
  
  <p>How can I test that a call to a controller PUT/update action actually change the Model attributes?</p>
  
  <p><strong>edit</strong></p>
  
  <p>If I inspect and evaluate <code>current_user</code> with binding.pry before and after the failing test, I see it actually changes. The test still fails tho</p>
  
  <pre><code>binding.pry
  expect{response}.to change{current_user.reload.email}.to('aieie@brazorf.com')
  binding.pry
  </code></pre>