Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add integration test support to app generation and testing

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3702 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 1a91abe6450b5bcb2a7fe1de1494b12c34288e50 1 parent 9507f5d
@jamis jamis authored
View
2  railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Add integration test support to app generation and testing [Jamis Buck]
+
* Added namespaces to all tasks, so for example load_fixtures is now db:fixtures:load. All the old task names are still valid, they just point to the new namespaced names. "rake -T" will only show the namespaced ones, though [DHH]
* CHANGED DEFAULT: ActiveRecord::Base.schema_format is now :ruby by default instead of :sql. This means that we'll assume you want to live in the world of db/schema.rb where the grass is green and the girls are pretty. If your schema contains un-dumpable elements, such as constraints or database-specific column types, you just got an invitation to either 1) patch the dumper to include foreign key support, 2) stop being db specific, or 3) just change the default in config/environment.rb to config.active_record.schema_format = :sql -- we even include an example for that on new Rails skeletons now. Brought to you by the federation of opinionated framework builders! [DHH]
View
2  railties/lib/code_statistics.rb
@@ -1,6 +1,6 @@
class CodeStatistics #:nodoc:
- TEST_TYPES = ['Units', 'Functionals', 'Unit tests', 'Functional tests']
+ TEST_TYPES = %w(Units Functionals Unit\ tests Functional\ tests Integration\ tests)
def initialize(*pairs)
@pairs = pairs
View
1  railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -124,6 +124,7 @@ def mysql_socket_location
script/process
test/fixtures
test/functional
+ test/integration
test/mocks/development
test/mocks/test
test/unit
View
17 railties/lib/tasks/statistics.rake
@@ -1,12 +1,13 @@
STATS_DIRECTORIES = [
- %w(Helpers app/helpers),
- %w(Controllers app/controllers),
- %w(APIs app/apis),
- %w(Components components),
- %w(Functional\ tests test/functional),
- %w(Models app/models),
- %w(Unit\ tests test/unit),
- %w(Libraries lib/)
+ %w(Helpers app/helpers),
+ %w(Controllers app/controllers),
+ %w(APIs app/apis),
+ %w(Components components),
+ %w(Functional\ tests test/functional),
+ %w(Models app/models),
+ %w(Unit\ tests test/unit),
+ %w(Libraries lib/),
+ %w(Integration\ tests test/integration)
].collect { |name, dir| [ name, "#{RAILS_ROOT}/#{dir}" ] }.select { |name, dir| File.directory?(dir) }
desc "Report code statistics (KLOCs, etc) from the application"
View
14 railties/lib/tasks/testing.rake
@@ -13,8 +13,13 @@ end
desc 'Test all units and functionals'
task :test do
- Rake::Task["test:units"].invoke rescue got_error = true
+ Rake::Task["test:units"].invoke rescue got_error = true
Rake::Task["test:functionals"].invoke rescue got_error = true
+
+ if File.exist?("test/integration")
+ Rake::Task["test:integration"].invoke rescue got_error = true
+ end
+
raise "Test failures" if got_error
end
@@ -45,6 +50,13 @@ namespace :test do
t.verbose = true
end
+ desc "Run the integration tests in test/integration"
+ Rake::TestTask.new(:integration => "db:test:prepare") do |t|
+ t.libs << "test"
+ t.pattern = 'test/integration/**/*_test.rb'
+ t.verbose = true
+ end
+
desc "Run the plugin tests in vendor/plugins/**/test (or specify with PLUGIN=name)"
Rake::TestTask.new(:plugins => :environment) do |t|
t.libs << "test"
View
1  railties/lib/test_help.rb
@@ -7,6 +7,7 @@
require 'test/unit'
require 'active_record/fixtures'
require 'action_controller/test_process'
+require 'action_controller/integration_test'
require 'action_web_service/test_invoke'
require 'breakpoint'
Please sign in to comment.
Something went wrong with that request. Please try again.