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

Error with rails-controller-testing and assert_template #460

Open
eLod opened this issue Apr 13, 2019 · 0 comments
Open

Error with rails-controller-testing and assert_template #460

eLod opened this issue Apr 13, 2019 · 0 comments

Comments

@eLod
Copy link

eLod commented Apr 13, 2019

assert_template tries to create a failure message and (Jbuilder) errors ("Failed to add 'inspect' property ..."), because it tries to inspect the Jbuilder (rails-controller-testing tracks locals, JbuilderTemplate passes json: self into sub-renders, like partials).

The problematic line in rails-controller-testing is https://github.com/rails/rails-controller-testing/blob/21014e48be124dd8d0af250b79f682519d445015/lib/rails/controller/testing/template_assertions.rb#L166, specifically the @_rendered_views.locals_for(view) (that returns an array, e.g. [BasicObject.new].to_s raises the same problem).

I understand Jbuilder tries to define as few methods as it must (and hence uses BasicObject), but i feel inspect is very specific to ruby, so it may not be a problem, in that case i'm happy to create a PR.

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

No branches or pull requests

1 participant