[英]Using tarantula to test a Rails app
I'm using Tarantula to test a Rails app I'm developing. 我正在使用Tarantula来测试正在开发的Rails应用程序。 It works pretty well, but I'm getting some strange 404s.
它工作得很好,但是我得到了一些奇怪的404。
After looking into it, Tarantula is following DELETE
requests ( destroy
actions on controllers) throughout my app when it tests. 经过研究,Tarantula在测试时会在我的整个应用程序中遵循
DELETE
请求( destroy
控制器上的动作)。 Since Tarantula gets the index
action first (and seems to keep a list of unvisited URLs), it eventually tries to follow a link to a resource which it had deleted... and gets a 404. Tarantula is right that the URL doesn't exist anymore (because it deleted the resource itself). 由于Tarantula首先获得了
index
操作(并且似乎保留了未访问的URL列表),因此它最终尝试跟随指向已删除的资源的链接……并获得404。Tarantula是正确的,URL没有不再存在(因为它删除了资源本身)。 However, it's flagging it as an error -- that's hardly the behavior I would expect. 但是,它会将其标记为错误-这几乎不是我期望的行为。
I'm basically just using the Rails scaffolding and this problem is happening. 我基本上只是在使用Rails脚手架,而这个问题正在发生。 How do I prevent Tarantula doing this?
如何防止塔兰图拉毒蛛这样做? (Or, is there a better way of specifying the links?)
(或者,是否有更好的方法指定链接?)
Updates: 更新:
From what I know, this is expected to be fixed in a future update of Tarantula. 据我所知,这有望在塔兰图拉毒蛛的未来更新中得到解决。 (See also: http://github.com/relevance/tarantula/issues#issue/3 .) For now, I'm ignoring 404s that "look harmless."
(另请参见: http : //github.com/relevance/tarantula/issues#issue/3 。)目前,我忽略了“看上去无害”的404。
UPDATE 更新
I'm now doing "soft deletes" (just marking records as deleted), so this isn't a problem for me anymore. 我现在正在执行“软删除”(只是将记录标记为已删除),所以这对我来说不再是问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.