RSpec partial match against a nested hash
<p>I've got a JSON structure that I'd like to match a single nested element in, while ignoring other data. The JSON looks like this (minimally):</p>

<pre><code>{
  "employee": {
    "id": 1,
    "jobs_count": 0
  },
  "messages": [ "something" ]
}
</code></pre>

<p>Here's what I'm using right now:</p>

<pre><code>response_json = JSON.parse(response.body)
expect(response_json).to include("employee")
expect(response_json["employee"]).to include("jobs_count" =&gt; 0)
</code></pre>

<p>What I'd like to do is something like:</p>

<pre><code>expect(response_json).to include("employee" =&gt; { "jobs_count" =&gt; 0 })
</code></pre>

<p>Unfortunately, <code>include</code> requires an exact match for anything but a simple top-level key check (at least with that syntax).</p>

<p><strong>Is there any way to partially match a nested hash while ignoring the rest of the structure?</strong></p>