Fix typo with instance variable
This commit is contained in:
parent
e0d984cac6
commit
961c6ac533
@ -96,7 +96,7 @@ module RablRails
|
||||
# missing method.
|
||||
#
|
||||
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
|
||||
|
||||
#
|
||||
|
@ -77,6 +77,14 @@ class TestJsonRenderer < ActiveSupport::TestCase
|
||||
assert_equal %q({}), render_json_output
|
||||
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
|
||||
# Set assigns
|
||||
@context.stub(:instance_variable_get).with(:@_assigns).and_return({'user' => @data})
|
||||
|
Loading…
Reference in New Issue
Block a user