I expect the ids in this method to be active record id's.
What actually happens.
The _ids from the mock_elasticsearch_response_sources method start at 1 and are automatically incremented from an each with index loop. Hence the ActiveRecord lookup fails, resulting in the error ActionView::Template::Error: 'nil' is not an ActiveModel-compatible object. It must implement :to_partial_path (because of a [nil] hash value).
Steps to reproduce the problem
In the hits hash in the helpers_spec.rb, change _id: from 1 (which is conveniently the first id in the loop) to 2. Spec fails. Passes again here
Expected behavior
I expect the ids in this method to be active record id's.
What actually happens.
The
_id
s from themock_elasticsearch_response_sources
method start at 1 and are automatically incremented from an each with index loop. Hence the ActiveRecord lookup fails, resulting in the errorActionView::Template::Error: 'nil' is not an ActiveModel-compatible object. It must implement :to_partial_path
(because of a[nil]
hash value).Steps to reproduce the problem
In the hits hash in the helpers_spec.rb, change
_id:
from 1 (which is conveniently the first id in the loop) to 2. Spec fails. Passes again hereVersion Information