title: How to test that method gets called with a mix of arguments and keyword arguments in rspec?
body: <p>I have a method that gets called like this:</p>
  
  <pre><code>post_signup(user,
              "fb signup completed",
              app_context: current_app_id,
              description: "Automatically Populated Via #{current_app_id}")
  </code></pre>
  
  <p>The arguments are a mix of values and keyword arguments. The one that I care about in the test is app_context. I tried something like this but it doesn't work:</p>
  
  <pre><code>it "should log an event with an app_context" do
          expect(controller).to receive(:post_signup).with(hash_including(app_context: current_app_id))
  
          subject
        end
  </code></pre>
  
  <p>and</p>
  
  <pre><code>it "should log an event with an app_context" do
          expect(controller).to receive(:post_signup).with(current_app_id, any_args)
  
          subject
        end
  </code></pre>
  
  <p>What can a man do?</p>