aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/commands/dbconsole_test.rb
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2017-07-16 14:54:04 +0200
committerRobin Dupret <robin.dupret@gmail.com>2017-07-16 15:10:39 +0200
commit3777701f1380f3814bd5313b225586dec64d4104 (patch)
treee77262bb855ee85c59b618648f17e2473854c815 /railties/test/commands/dbconsole_test.rb
parent48b249927375465a7102acc71c2dfb8d49af8309 (diff)
downloadrails-3777701f1380f3814bd5313b225586dec64d4104.tar.gz
rails-3777701f1380f3814bd5313b225586dec64d4104.tar.bz2
rails-3777701f1380f3814bd5313b225586dec64d4104.zip
Properly expand the environment's name
Running the `console` and `dbconsole` commands with a regular argument as the environment's name automatically expand it to match an existing environment (e.g. dev for development). This feature wasn't available using the `--environment` (a.k.a `-e`) option.
Diffstat (limited to 'railties/test/commands/dbconsole_test.rb')
-rw-r--r--railties/test/commands/dbconsole_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/test/commands/dbconsole_test.rb b/railties/test/commands/dbconsole_test.rb
index e6a67c2c49..4f55eb9aa6 100644
--- a/railties/test/commands/dbconsole_test.rb
+++ b/railties/test/commands/dbconsole_test.rb
@@ -105,6 +105,12 @@ class Rails::DBConsoleTest < ActiveSupport::TestCase
end
end
+ def test_rails_env_is_development_when_environment_option_is_dev
+ stub_available_environments([ "development", "test" ]) do
+ assert_match("development", parse_arguments([ "-e", "dev" ])[:environment])
+ end
+ end
+
def test_rails_env_is_dev_when_argument_is_dev_and_dev_env_is_present
assert_deprecated do
stub_available_environments([ "dev" ]) do