aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorJan Xie <jan.h.xie@gmail.com>2011-05-05 17:15:22 +0800
committerJan Xie <jan.h.xie@gmail.com>2011-05-05 17:15:22 +0800
commitebc5ef0e6662cb3aa0b5098e23b39eb56364b235 (patch)
tree652d0948f719e71a1ad2088706e51453aa39bf7b /railties/test/application
parent25288c137c745714d23bd8b00194027aefc8ac1b (diff)
downloadrails-ebc5ef0e6662cb3aa0b5098e23b39eb56364b235.tar.gz
rails-ebc5ef0e6662cb3aa0b5098e23b39eb56364b235.tar.bz2
rails-ebc5ef0e6662cb3aa0b5098e23b39eb56364b235.zip
add tests for performance test
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/test_test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/railties/test/application/test_test.rb b/railties/test/application/test_test.rb
index 1fbbb40132..f96319f472 100644
--- a/railties/test/application/test_test.rb
+++ b/railties/test/application/test_test.rb
@@ -65,6 +65,31 @@ module ApplicationTests
run_test 'integration/posts_test.rb'
end
+ test "performance test" do
+ controller 'posts', <<-RUBY
+ class PostsController < ActionController::Base
+ end
+ RUBY
+
+ app_file 'app/views/posts/index.html.erb', <<-HTML
+ Posts#index
+ HTML
+
+ app_file 'test/performance/posts_test.rb', <<-RUBY
+ require 'test_helper'
+ require 'rails/performance_test_help'
+
+ class PostsTest < ActionDispatch::PerformanceTest
+ def test_index
+ get '/posts'
+ assert_response :success
+ end
+ end
+ RUBY
+
+ run_test 'performance/posts_test.rb'
+ end
+
private
def run_test(name)
result = ruby '-Itest', "#{app_path}/test/#{name}"