Rspec 和 SQL:索引 0 超出范围

Rspec and SQL: Index 0 is out of range

我正在尝试 运行 我的代码,但出现以下错误:

Failure/Error: Bookmark.new(id: res[0]['id'], title: res[0]['title'], url: res[0]['url'])
 IndexError: Index 0 is out of range

我检查了我的数据库 table 发现一切正常,那里有数据(书签)所以不确定为什么会这样。

抱歉,这是我的错误。与我的代码相比,我的 spec_helper 文件指的是不同的环境。这就是它找不到所需数据的原因。这至少是下次学习的好方法