2008-01-17

关于rails2.0的测试问题

关键字: test
关于rails2.0的测试有一些疑惑,始终没有解决。关于rails2.0测试方面也发生了一些变化!
例如:
以前在生成的功能测试中有:
require File.dirname(__FILE__) + '/../test_helper'
require 'search_controller'

但是现在生成的功能测试与之对应控制器这行
require 'search_controller'

没有了,还有就是
class SearchController; def rescue_action(e) raise e end; end

  def setup
    @controller = SearchController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new 
end

这个方法也没有,不知道现在是内定的还是需要写其他的东西?
请各位知道的给讲解以下!谢谢了,急用!
评论
张云洁 2008-01-18
花花公子 写道
是不需要了,因为现在继承的是 ActionController::TestCase, 而不是简单的继承 Test::Unit::TestCase。

明白了,不过能举例说明以下rails2.0的功能测试更好,谢谢了!另外,怎么在测试里面,测试修改字段值的方法,并保存到测试数据库里面,我试了很多次,总是不能保存到数据库里面,不知道是哪的错误,有那位知道的,请举例说明以下,
花花公子 2008-01-17
是不需要了,因为现在继承的是 ActionController::TestCase, 而不是简单的继承 Test::Unit::TestCase。
张云洁 2008-01-17
那位高手会啊,帮忙啊!
发表评论

提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则

您还没有登录,请登录后发表评论

张云洁
搜索本博客
最近加入圈子
存档
最新评论