diff --git a/appveyor.yml b/appveyor.yml index 1fc009903..fe5971a6f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,6 +4,7 @@ skip_tags: true environment: JRUBY_OPTS: "--dev -J-Xmx1024M --debug" + RAILS_VERSION: 5.2 matrix: - ruby_version: "Ruby23" - ruby_version: "Ruby23-x64" @@ -13,6 +14,9 @@ cache: install: - SET PATH=C:\%ruby_version%\bin;%PATH% + - gem uninstall bundler -a -x -I + - gem update --system 2.7.9 + - # gem install bundler -v '1.17.3' - bundle env - bundle check || bundle install --path=vendor/bundle --retry=3 --jobs=3 - bundle clean --force diff --git a/test/cache_test.rb b/test/cache_test.rb index 9f82317ac..fdab362a2 100644 --- a/test/cache_test.rb +++ b/test/cache_test.rb @@ -164,7 +164,7 @@ def test_expiring_of_cache_at_update_of_record assert_equal 'Foo', author_json[:name] - author.update_attributes(name: 'Bar') + author.update(name: 'Bar') author_json = AuthorSerializerWithCache.new(author).as_json expected = 'Bar' @@ -202,10 +202,12 @@ def test_cache_expiration_in_collection_on_update_of_record end bar = 'Bar' - author.update!(name: bar) + Timecop.travel(10.seconds.from_now) do + author.update!(name: bar) - collection_json = render_object_with_cache(author_collection, each_serializer: AuthorSerializerWithCache) - assert_equal [{ name: bar }, { name: bar }, { name: foo2 }], collection_json + collection_json = render_object_with_cache(author_collection, each_serializer: AuthorSerializerWithCache) + assert_equal [{ name: bar }, { name: bar }, { name: foo2 }], collection_json + end ensure ARModels::Author.cache_versioning = original_cache_versioning unless original_cache_versioning == :none end