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

Bug in the mock_elasticsearch_response_sources method #862

Closed
lafeber opened this issue Oct 19, 2022 · 0 comments · Fixed by #861
Closed

Bug in the mock_elasticsearch_response_sources method #862

lafeber opened this issue Oct 19, 2022 · 0 comments · Fixed by #861

Comments

@lafeber
Copy link
Contributor

lafeber commented Oct 19, 2022

Expected behavior

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

Version Information

  • Chewy version: 7.2.6 (latest)
  • Elasticsearch version: any
  • Ruby version: any
  • Rails version: any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant