spec/gon/gon_spec.rb in gon-2.0.3 vs spec/gon/gon_spec.rb in gon-2.0.4

- old
+ new

@@ -47,9 +47,18 @@ controller.instance_variable_set('@objects', objects) Gon.rabl 'spec/test_data/sample.rabl', :controller => controller Gon.objects.length.should == 2 end + it 'render json from jbuilder template' do + Gon.clear + controller = ActionController::Base.new + objects = [1,2] + controller.instance_variable_set('@objects', objects) + Gon.jbuilder 'spec/test_data/sample.json.jbuilder', :controller => controller + Gon.objects.length.should == 2 + end + def request @request ||= double 'request', :env => {} end end