aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/rake_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/application/rake_test.rb')
-rw-r--r--railties/test/application/rake_test.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index fed9dce8e1..27d521485c 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -123,12 +123,13 @@ module ApplicationTests
end
def test_scaffold_tests_pass_by_default
- content = Dir.chdir(app_path) do
+ output = Dir.chdir(app_path) do
`rails generate scaffold user username:string password:string;
bundle exec rake db:migrate db:test:clone test`
end
- assert_match(/\d+ tests, \d+ assertions, 0 failures, 0 errors/, content)
+ assert_match(/7 tests, 13 assertions, 0 failures, 0 errors/, output)
+ assert_no_match(/Errors running/, output)
end
def test_rake_dump_structure_should_respect_db_structure_env_variable
@@ -139,6 +140,18 @@ module ApplicationTests
assert File.exists?(File.join(app_path, 'db', 'my_structure.sql'))
end
+ def test_rake_dump_structure_should_be_called_twice_when_migrate_redo
+ add_to_config "config.active_record.schema_format = :sql"
+
+ output = Dir.chdir(app_path) do
+ `rails g model post title:string;
+ bundle exec rake db:migrate:redo 2>&1 --trace;`
+ end
+
+ # expect only Invoke db:structure:dump (first_time)
+ assert_no_match(/^\*\* Invoke db:structure:dump\s+$/, output)
+ end
+
def test_rake_dump_schema_cache
Dir.chdir(app_path) do
`rails generate model post title:string;