aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorclaudiob <claudiob@gmail.com>2016-03-09 07:29:17 -0800
committerclaudiob <claudiob@gmail.com>2016-03-09 07:29:17 -0800
commit5c99a4b93e99cac2bc00fa79da6d79aa37582890 (patch)
tree4047cf5cb578b288bc335f0de3f5897647c4bd24 /railties/test
parentb165d73f2ccd421c9f3518ce9bf5bcb322440cb7 (diff)
downloadrails-5c99a4b93e99cac2bc00fa79da6d79aa37582890.tar.gz
rails-5c99a4b93e99cac2bc00fa79da6d79aa37582890.tar.bz2
rails-5c99a4b93e99cac2bc00fa79da6d79aa37582890.zip
AppGenerator: allow both 'rake' and 'rails'
This commit comes from the comments made by @matthewd at https://github.com/rails/rails/pull/23795/files#r54469637 and by @rafaelfranca at https://github.com/rails/rails/pull/23795/files#r54609364 The idea is that if you type (for example) "rake db:migrate" in an AppGenerator, then this should actually invoke `rake db:migrate` on the command line, whereas if you type "rails_command db:migrate", this should invoke `rails db:migrate`.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/actions_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index 58394a11f0..3b2b3c37d0 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -202,7 +202,7 @@ class ActionsTest < Rails::Generators::TestCase
end
def test_rails_should_run_rake_command_with_default_env
- assert_called_with(generator, :run, ["rails log:clear RAILS_ENV=development", verbose: false]) do
+ assert_called_with(generator, :run, ["rake log:clear RAILS_ENV=development", verbose: false]) do
with_rails_env nil do
action :rake, 'log:clear'
end
@@ -210,13 +210,13 @@ class ActionsTest < Rails::Generators::TestCase
end
def test_rails_with_env_option_should_run_rake_command_in_env
- assert_called_with(generator, :run, ['rails log:clear RAILS_ENV=production', verbose: false]) do
+ assert_called_with(generator, :run, ['rake log:clear RAILS_ENV=production', verbose: false]) do
action :rake, 'log:clear', env: 'production'
end
end
test "rails command with RAILS_ENV variable should run rake command in env" do
- assert_called_with(generator, :run, ['rails log:clear RAILS_ENV=production', verbose: false]) do
+ assert_called_with(generator, :run, ['rake log:clear RAILS_ENV=production', verbose: false]) do
with_rails_env "production" do
action :rake, 'log:clear'
end
@@ -224,7 +224,7 @@ class ActionsTest < Rails::Generators::TestCase
end
test "env option should win over RAILS_ENV variable when running rake" do
- assert_called_with(generator, :run, ['rails log:clear RAILS_ENV=production', verbose: false]) do
+ assert_called_with(generator, :run, ['rake log:clear RAILS_ENV=production', verbose: false]) do
with_rails_env "staging" do
action :rake, 'log:clear', env: 'production'
end
@@ -232,7 +232,7 @@ class ActionsTest < Rails::Generators::TestCase
end
test "rails command with sudo option should run rake command with sudo" do
- assert_called_with(generator, :run, ["sudo rails log:clear RAILS_ENV=development", verbose: false]) do
+ assert_called_with(generator, :run, ["sudo rake log:clear RAILS_ENV=development", verbose: false]) do
with_rails_env nil do
action :rake, 'log:clear', sudo: true
end