title: Rspec: Check if array includes object which includes property
body: <p>I have a json array full of objects. </p>
  
  <pre><code>my_array = [{id =&gt; 6, name =&gt; "bob"}, 
             {id =&gt; 5, name =&gt; "jim"}, 
             {id =&gt; 2, name =&gt; "steve"}]
  </code></pre>
  
  <p>I need to see if the array holds an object which contains an attribute "id" that is set to 5. The "name" attribute is unknown.</p>
  
  <p>How do I do this in rspec?</p>
  
  <p>I know if I had the name attribute I know I could just do:</p>
  
  <pre><code>my_array.should include({:id =&gt; 5, :name =&gt; "jim"}) 
  </code></pre>