Rails 3.2.11 performance testing problem: I don’t know how to build the "test: benchmark" task

I follow this railscast when testing performance, but I immediately have a problem.

My application is rails 3.2.11, so according to railscast it should include performance testing, but I don’t have a folder called "test". When I run "rails generating the Performance_test homepage" nothing happens or is not created. So I created one of them manually (to exactly match the railscast source code), but when I run rake test: testmark, I get an error

Don't know how to build task 'test:benchmark' 

If I add the "rails-perftest" pearl to my gemfile and run the package, then try creating Performance_test and nothing will happen, and when I run the rake: benchmark test, it gives another error

 uninitialized constant Rails::SubTestTask 

I have definitely included the following dependencies in my gem file:

  gem 'ruby-prof', group: :test gem 'test-unit', group: :test 

Can someone help me tell me what I'm doing wrong? Thanks!

+8
ruby-on-rails-3 testing rake
source share
1 answer

I am not 100% sure of this, but I assume that your application.rb file may not be configured accordingly. Also check out the Gemfile.lock file and run the bundle install command because it can also be something funky with your jewelry and dependencies.

+1
source share

All Articles