diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-07-17 19:38:54 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-07-17 19:45:51 +0530 |
commit | e5a6f7ee9e951dbe0e4e9ea2c0743b4dfb135c57 (patch) | |
tree | c453ef5911af803843705f7790c6ba05e70d5e24 /railties/test/generators | |
parent | fd8ab8781488923c034200b83278d10dd8c90ba6 (diff) | |
download | rails-e5a6f7ee9e951dbe0e4e9ea2c0743b4dfb135c57.tar.gz rails-e5a6f7ee9e951dbe0e4e9ea2c0743b4dfb135c57.tar.bz2 rails-e5a6f7ee9e951dbe0e4e9ea2c0743b4dfb135c57.zip |
Setup default session store internally, no longer through an application initializer
- By default the session store will be set to cookie store with
application name as session key.
- Older apps are not affected as they will have the session store
initializer generated by Rails in older versions, and Rails will not
overwrite the session store if it is already set or disabled.
- But new apps will not have the initializer, instead the session store
will be set to cookie store by default.
- Based on comment by DHH here - https://github.com/rails/rails/issues/25181#issuecomment-222312764.
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/api_app_generator_test.rb | 1 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 10 |
2 files changed, 0 insertions, 11 deletions
diff --git a/railties/test/generators/api_app_generator_test.rb b/railties/test/generators/api_app_generator_test.rb index 92779452e1..9ad936710d 100644 --- a/railties/test/generators/api_app_generator_test.rb +++ b/railties/test/generators/api_app_generator_test.rb @@ -108,7 +108,6 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase app/views/layouts/application.html.erb config/initializers/assets.rb config/initializers/cookies_serializer.rb - config/initializers/session_store.rb lib/assets vendor/assets test/helpers diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index ac1488abb3..50751368c8 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -131,7 +131,6 @@ class AppGeneratorTest < Rails::Generators::TestCase generator.send(:app_const) quietly { generator.send(:update_config_files) } assert_file "myapp_moved/config/environment.rb", /Rails\.application\.initialize!/ - assert_file "myapp_moved/config/initializers/session_store.rb", /_myapp_session/ end end end @@ -144,7 +143,6 @@ class AppGeneratorTest < Rails::Generators::TestCase generator = Rails::Generators::AppGenerator.new ["rails"], [], destination_root: app_root, shell: @shell generator.send(:app_const) quietly { generator.send(:update_config_files) } - assert_file "myapp/config/initializers/session_store.rb", /_myapp_session/ end end @@ -552,13 +550,6 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_file "config/application.rb", /\s+require\s+["']active_job\/railtie["']/ end - def test_new_hash_style - run_generator - assert_file "config/initializers/session_store.rb" do |file| - assert_match(/config.session_store :cookie_store, key: '_.+_session'/, file) - end - end - def test_pretend_option output = run_generator [File.join(destination_root, "myapp"), "--pretend"] assert_no_match(/run bundle install/, output) @@ -571,7 +562,6 @@ class AppGeneratorTest < Rails::Generators::TestCase run_generator [path, "-d", 'postgresql'] assert_file "foo bar/config/database.yml", /database: foo_bar_development/ - assert_file "foo bar/config/initializers/session_store.rb", /key: '_foo_bar/ end def test_web_console |