我创建了一个基本的应用,控制器 news,默认 root 为"news/index",使用 http://localhost:3000/可以直接访问到新闻:
require 'test_helper' require 'rails/performance_test_help'
class HomepageTest < ActionDispatch::PerformanceTest # Refer to the documentation for all available options # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory] # :output => 'tmp/performance', :formats => [:flat] }
def test_homepage get '/' end
在应用程序目录运行 rake test:benchmark 总是报错,不知道问题出在哪里了。
Specify ruby-prof as application's dependency in Gemfile to run benchmarks.