Fix typo with instance variable

This commit is contained in:
ccocchi 2012-05-02 17:53:13 +02:00
parent e0d984cac6
commit 961c6ac533
2 changed files with 9 additions and 1 deletions

View File

@ -96,7 +96,7 @@ module RablRails
# missing method. # missing method.
# #
def method_missing(name, *args, &block) def method_missing(name, *args, &block)
@context.respond_to?(name) ? @context.send(name, *args, &block) : super @_context.respond_to?(name) ? @_context.send(name, *args, &block) : super
end end
# #

View File

@ -76,6 +76,14 @@ class TestJsonRenderer < ActiveSupport::TestCase
@template.source = { :name => [condition, proc] } @template.source = { :name => [condition, proc] }
assert_equal %q({}), render_json_output assert_equal %q({}), render_json_output
end end
test "node with context method call" do
@context.stub(:respond_to?).with(:context_method).and_return(true)
@context.stub(:context_method).and_return('marty')
proc = lambda { |object| context_method }
@template.source = { :name => proc }
assert_equal %q({"name":"marty"}), render_json_output
end
test "partial should be evaluated at rendering time" do test "partial should be evaluated at rendering time" do
# Set assigns # Set assigns