aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-01-06 15:01:14 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-01-06 15:12:19 +0900
commit229064cf3a4da96ad3e30114d99288bf6660ed58 (patch)
treebc6d2b058bf4e1dff59cca4871be23f09ca8ed8f /railties/test
parent333aab3d51124a00c7f2ba498d4910eb7cb570e6 (diff)
downloadrails-229064cf3a4da96ad3e30114d99288bf6660ed58.tar.gz
rails-229064cf3a4da96ad3e30114d99288bf6660ed58.tar.bz2
rails-229064cf3a4da96ad3e30114d99288bf6660ed58.zip
make generated controller test work correctly
Since the `#file_name` that not consideration for the namespace, if generate a controller with a namespace, not the correct url helper generation, it had become an error to run the test. Modified to generate the correct url helper, even if it is produced a namespace with controller.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/test_runner_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb
index 92a9b99fd8..868153762d 100644
--- a/railties/test/application/test_runner_test.rb
+++ b/railties/test/application/test_runner_test.rb
@@ -234,6 +234,11 @@ module ApplicationTests
assert_match "0 failures, 0 errors, 0 skips", run_test_command('')
end
+ def test_generated_controller_works_with_rails_test
+ create_controller
+ assert_match "0 failures, 0 errors, 0 skips", run_test_command('')
+ end
+
def test_run_multiple_folders
create_test_file :models, 'account'
create_test_file :controllers, 'accounts_controller'
@@ -449,6 +454,10 @@ module ApplicationTests
run_migration
end
+ def create_controller
+ script 'generate controller admin/dashboard index'
+ end
+
def run_migration
Dir.chdir(app_path) { `bin/rake db:migrate` }
end