We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25d5ff6 commit 4259863Copy full SHA for 4259863
spec/gon/gon_spec.rb
@@ -40,7 +40,16 @@
40
lambda { Gon.all_variables = 123 }.should raise_error
41
end
42
43
+ it 'render json from rabl template' do
44
+ Gon.clear
45
+ controller = ActionController::Base.new
46
+ objects = [1,2]
47
+ controller.instance_variable_set('@objects', objects)
48
+ Gon.rabl 'spec/test_data/sample.rabl', :controller => controller
49
+ Gon.objects.length.should == 2
50
+ end
51
+
52
def request
53
@request ||= double 'request', :env => {}
54
-end
55
+end
spec/test_data/sample.rabl
@@ -0,0 +1,2 @@
1
+collection @objects => 'objects'
2
+attributes :id
0 commit comments