title: how to test for inserts in database?
body: <p>I have an rspec test of a method that inserts or returns the first record if a record with given attributes doesn't exist. It looks like this</p>
  
  <pre><code>context "user doesn't exist" do
    subject { User.find_or_create(name: "Jonh", login: "john") }
  
    it { should be_an_instance_of(User) }
  
    //and here I want to test that new user was inserted into database...
  
  end
  </code></pre>
  
  <p>but I can't figure out how to use <code>expect to change</code> in this.</p>