Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SafeCacheKey + Touch doesn't pass spec/integration/mongoid_spec.rb #83

Open
dblock opened this issue Oct 15, 2014 · 1 comment
Open

Comments

@dblock
Copy link
Contributor

dblock commented Oct 15, 2014

SafeCacheKey + Touch doesn't pass spec/integration/mongoid_spec.rb.

  1) Mongoid integration using Garner::Strategies::Binding::Key::SafeCacheKey with Garner::Strategies::Binding::Invalidation::Touch end-to-end caching and invalidation binding at the instance level binding via find does not invalidate results for other like-classed objects
     Failure/Error: cached_object_namer.call.should eq 'M1'

       expected: "M1"
            got: "M2"

       (compared using ==)
     # ./spec/integration/mongoid_spec.rb:176:in `block (8 levels) in <top (required)>'
     # ./spec/support/active_record.rb:32:in `block (3 levels) in <top (required)>'
     # ./spec/support/active_record.rb:31:in `block (2 levels) in <top (required)>'

  2) Mongoid integration using Garner::Strategies::Binding::Key::SafeCacheKey with Garner::Strategies::Binding::Invalidation::Touch end-to-end caching and invalidation binding at the instance level binding via find with an embedded document with :invalidate_mongoid_root = true invalidates the root document
     Failure/Error: root_cached_object_namer.call.should eq 'Sockeye'

       expected: "Sockeye"
            got: "Trout"

       (compared using ==)
     # ./spec/integration/mongoid_spec.rb:269:in `block (10 levels) in <top (required)>'
     # ./spec/support/active_record.rb:32:in `block (3 levels) in <top (required)>'
     # ./spec/support/active_record.rb:31:in `block (2 levels) in <top (required)>'

  3) Mongoid integration using Garner::Strategies::Binding::Key::SafeCacheKey with Garner::Strategies::Binding::Invalidation::Touch end-to-end caching and invalidation binding at the instance level binding via identify does not invalidate results for other like-classed objects
     Failure/Error: cached_object_namer.call.should eq 'M1'

       expected: "M1"
            got: "M2"

       (compared using ==)
     # ./spec/integration/mongoid_spec.rb:176:in `block (8 levels) in <top (required)>'
     # ./spec/support/active_record.rb:32:in `block (3 levels) in <top (required)>'
     # ./spec/support/active_record.rb:31:in `block (2 levels) in <top (required)>'

  4) Mongoid integration using Garner::Strategies::Binding::Key::SafeCacheKey with Garner::Strategies::Binding::Invalidation::Touch end-to-end caching and invalidation binding at the instance level binding via identify with an embedded document with :invalidate_mongoid_root = true invalidates the root document
     Failure/Error: root_cached_object_namer.call.should eq 'Sockeye'

       expected: "Sockeye"
            got: "Trout"

       (compared using ==)
     # ./spec/integration/mongoid_spec.rb:269:in `block (10 levels) in <top (required)>'
     # ./spec/support/active_record.rb:32:in `block (3 levels) in <top (required)>'
     # ./spec/support/active_record.rb:31:in `block (2 levels) in <top (required)>'
@dblock
Copy link
Contributor Author

dblock commented Feb 11, 2016

A simple example where you bind on a model doesn't work either, the following code never hits the cache.

get do
   garner.bind(Widget) do
       Widget.all
   end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant