I checked out this project to make a pull request, but ended up getting a failing spec. The first error I got was the following
1) MultiFetchFragments works for passing in a custom key
Failure/Error: cache_mock = mock()
NoMethodError:
undefined method `mock' for #<RSpec::ExampleGroups::MultiFetchFragments:0x007fc4a30a8b50>
# ./spec/multi_fetch_fragments_spec.rb:12:in `block (2 levels) in <top (required)>'
I changed the mock call to double() and then got this error
1) MultiFetchFragments works for passing in a custom key
Failure/Error: view.render(:partial => "views/customer", :collection => [ customer ], :cache => Proc.new{ |item| [item, 'key']}).should == "Hello"
NoMethodError:
undefined method `read_multi' for nil:NilClass
# ./lib/multi_fetch_fragments.rb:45:in `render_collection_with_multi_fetch_cache'
# ./spec/multi_fetch_fragments_spec.rb:24:in `block (2 levels) in <top (required)>'
To fix that, I set Rails.cache to the cache mock variable and everything started passing again.
I also included a Gemfile.lock anyone who pulls down the gem for development, will be using the same version of rspec.
I checked out this project to make a pull request, but ended up getting a failing spec. The first error I got was the following
I changed the mock call to double() and then got this error
To fix that, I set
Rails.cache
to the cache mock variable and everything started passing again.I also included a Gemfile.lock anyone who pulls down the gem for development, will be using the same version of rspec.