I'm using Rails 3.2.16, rspec-rails 2.14.1 and jbuilder 2.0.2 and found out that rspec is not yielding the "json" object when rendering jbuilder partials using:
render :partial => 'my_partial'
where "my_partial" is a _mypartial.jbuilder file. It throws an error as if the "json" object used in the template was not there. My template does something very simple, like:
json.foo "bar"
json.bar "foo"
The error, in this case, would be: undefined method `foo' for nil:NilClass
On the other hand, when doing something like:
render 'template'
and inside 'template.jbuilder' we have something like:
json.partial! 'my_template'
it works fine.
Yes, I'm using "render_views" on my spec group.
Has anyone caught this error before?