module GdsApi::TestHelpers::Rummager

def stub_any_rummager_post(index: nil)

def stub_any_rummager_post(index: nil)
  if index
    stub_request(:post, %r{#{RUMMAGER_ENDPOINT}/#{index}/documents})
      .to_return(status: [202, "Accepted"])
  else
    stub_request(:post, %r{#{RUMMAGER_ENDPOINT}/documents})
      .to_return(status: [202, "Accepted"])
  end
end