diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-05-18 18:12:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-18 18:12:32 +0200 |
commit | 75fa8dd309a84e125b59d01bf182d88419631eaa (patch) | |
tree | d76aa54a79b7bf07d6e6c5d3f6c07237e5f4af60 /railties/test | |
parent | 385d9af299fbfac7f063de214d371545bafef5df (diff) | |
download | rails-75fa8dd309a84e125b59d01bf182d88419631eaa.tar.gz rails-75fa8dd309a84e125b59d01bf182d88419631eaa.tar.bz2 rails-75fa8dd309a84e125b59d01bf182d88419631eaa.zip |
Use recyclable cache keys (#29092)
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/per_request_digest_cache_test.rb | 4 | ||||
-rw-r--r-- | railties/test/generators/api_app_generator_test.rb | 1 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/railties/test/application/per_request_digest_cache_test.rb b/railties/test/application/per_request_digest_cache_test.rb index 6c003e9bcc..6e6996a6ba 100644 --- a/railties/test/application/per_request_digest_cache_test.rb +++ b/railties/test/application/per_request_digest_cache_test.rb @@ -18,6 +18,10 @@ class PerRequestDigestCacheTest < ActiveSupport::TestCase class Customer < Struct.new(:name, :id) extend ActiveModel::Naming include ActiveModel::Conversion + + def cache_key + [ name, id ].join("/") + end end RUBY diff --git a/railties/test/generators/api_app_generator_test.rb b/railties/test/generators/api_app_generator_test.rb index 2edb39c8e8..a19e0f0dd8 100644 --- a/railties/test/generators/api_app_generator_test.rb +++ b/railties/test/generators/api_app_generator_test.rb @@ -70,7 +70,6 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase assert_no_file "config/initializers/cookies_serializer.rb" assert_no_file "config/initializers/assets.rb" - assert_no_file "config/initializers/new_framework_defaults_5_1.rb" end def test_app_update_does_not_generate_unnecessary_bin_files diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index ed8eea3243..ff829eb197 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -157,7 +157,7 @@ class AppGeneratorTest < Rails::Generators::TestCase end def test_new_application_doesnt_need_defaults - assert_no_file "config/initializers/new_framework_defaults_5_1.rb" + assert_no_file "config/initializers/new_framework_defaults_5_2.rb" end def test_new_application_load_defaults @@ -203,14 +203,14 @@ class AppGeneratorTest < Rails::Generators::TestCase app_root = File.join(destination_root, "myapp") run_generator [app_root] - assert_no_file "#{app_root}/config/initializers/new_framework_defaults_5_1.rb" + assert_no_file "#{app_root}/config/initializers/new_framework_defaults_5_2.rb" stub_rails_application(app_root) do generator = Rails::Generators::AppGenerator.new ["rails"], { update: true }, destination_root: app_root, shell: @shell generator.send(:app_const) quietly { generator.send(:update_config_files) } - assert_file "#{app_root}/config/initializers/new_framework_defaults_5_1.rb" + assert_file "#{app_root}/config/initializers/new_framework_defaults_5_2.rb" end end |