aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/rake
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-12-06 21:41:00 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-12-06 21:43:14 -0200
commit43c284297b7487a794d0fe1ea1ffd507b0c45991 (patch)
tree8e33accc1870161ea2bda400abd0404211e822f2 /railties/test/application/rake
parent4a2b739f047051b5df6dc56bb6fbbe388aa86aca (diff)
downloadrails-43c284297b7487a794d0fe1ea1ffd507b0c45991.tar.gz
rails-43c284297b7487a794d0fe1ea1ffd507b0c45991.tar.bz2
rails-43c284297b7487a794d0fe1ea1ffd507b0c45991.zip
Run rake tasks all at once in rake dbs test for a speed up
Before: Finished tests in 56.245787s, 0.2133 tests/s, 0.0000 assertions/s. 12 tests, 0 assertions, 0 failures, 0 errors, 0 skips After: Finished tests in 42.401416s, 0.2830 tests/s, 0.0000 assertions/s. 12 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Diffstat (limited to 'railties/test/application/rake')
-rw-r--r--railties/test/application/rake/dbs_test.rb18
1 files changed, 6 insertions, 12 deletions
diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb
index 03798d572a..ca19be3c52 100644
--- a/railties/test/application/rake/dbs_test.rb
+++ b/railties/test/application/rake/dbs_test.rb
@@ -79,8 +79,7 @@ module ApplicationTests
def db_schema_dump
Dir.chdir(app_path) do
`rails generate model book title:string`
- `rake db:migrate`
- `rake db:schema:dump`
+ `rake db:migrate db:schema:dump`
schema_dump = File.read("db/schema.rb")
assert_match(/create_table \"books\"/, schema_dump)
end
@@ -98,8 +97,7 @@ module ApplicationTests
def db_fixtures_load
Dir.chdir(app_path) do
`rails generate model book title:string`
- `bundle exec rake db:migrate`
- `bundle exec rake db:fixtures:load`
+ `bundle exec rake db:migrate db:fixtures:load`
assert_match(/#{expected[:database]}/,
ActiveRecord::Base.connection_config[:database])
require "#{app_path}/app/models/book"
@@ -123,12 +121,10 @@ module ApplicationTests
def db_structure_dump_and_load
Dir.chdir(app_path) do
`rails generate model book title:string`
- `bundle exec rake db:migrate`
- `bundle exec rake db:structure:dump`
+ `bundle exec rake db:migrate db:structure:dump`
structure_dump = File.read("db/structure.sql")
assert_match(/CREATE TABLE \"books\"/, structure_dump)
- `bundle exec rake db:drop`
- `bundle exec rake db:structure:load`
+ `bundle exec rake db:drop db:structure:load`
assert_match(/#{expected[:database]}/,
ActiveRecord::Base.connection_config[:database])
require "#{app_path}/app/models/book"
@@ -153,9 +149,7 @@ module ApplicationTests
def db_test_load_structure
Dir.chdir(app_path) do
`rails generate model book title:string`
- `bundle exec rake db:migrate`
- `bundle exec rake db:structure:dump`
- `bundle exec rake db:test:load_structure`
+ `bundle exec rake db:migrate db:structure:dump db:test:load_structure`
ActiveRecord::Base.configurations = Rails.application.config.database_configuration
ActiveRecord::Base.establish_connection 'test'
require "#{app_path}/app/models/book"
@@ -178,4 +172,4 @@ module ApplicationTests
end
end
end
-end \ No newline at end of file
+end