diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-12-13 12:35:24 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-13 12:35:24 +0900 |
commit | 293401809dc597a61e46843019ee8be6ce731429 (patch) | |
tree | 17f8cfed3bfbab1532040b7bd2a61bbde6466b63 /activerecord/test/cases/base_test.rb | |
parent | 9d43a84f73c1b3853a91d052a462ee60eccaf957 (diff) | |
parent | 011e641d19d235e4ec03fd9eb20ecea644ec5e06 (diff) | |
download | rails-293401809dc597a61e46843019ee8be6ce731429.tar.gz rails-293401809dc597a61e46843019ee8be6ce731429.tar.bz2 rails-293401809dc597a61e46843019ee8be6ce731429.zip |
Merge pull request #31423 from bogdanvlviv/fix-protected_environments-with-symbols
Fix protected environments with symbols
Diffstat (limited to 'activerecord/test/cases/base_test.rb')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 875b98f0b8..7fc4a396e4 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1503,4 +1503,16 @@ class BasicsTest < ActiveRecord::TestCase assert_match(/SELECT #{quoted_id}.* FROM `developers`/, query) end + + test "protected environments by default is an array with production" do + assert_equal ["production"], ActiveRecord::Base.protected_environments + end + + def test_protected_environments_are_stored_as_an_array_of_string + previous_protected_environments = ActiveRecord::Base.protected_environments + ActiveRecord::Base.protected_environments = [:staging, "production"] + assert_equal ["staging", "production"], ActiveRecord::Base.protected_environments + ensure + ActiveRecord::Base.protected_environments = previous_protected_environments + end end |