def METHOD_NAME(link, expected, requests_mock):
    def mocked_get(req, context):
        if req.url.startswith("https://doi.org"):
            context.status_code = 302
            context.headers["Location"] = link
        return link
    requests_mock.get(re.compile("https://"), text=mocked_get)
    fig = Figshare()
    fig.detect("10.6084/m9.figshare.9782777")
    assert fig.content_id == expected