diff options
| -rw-r--r-- | lib/zorglub/node.rb | 4 | ||||
| -rw-r--r-- | spec/node_spec.rb | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb index 83947fd..1c77438 100644 --- a/lib/zorglub/node.rb +++ b/lib/zorglub/node.rb @@ -236,11 +236,11 @@ module Zorglub node.realize! end - def partial(env, meth, *args) + def partial(meth, *args, env: {}, no_hooks: false) node = new(env, meth.to_s, args, partial: true) return error404 node, meth unless node.respond_to? meth - node.feed!(no_hooks: env[:no_hooks]) + node.feed!(no_hooks: no_hooks) node.content end diff --git a/spec/node_spec.rb b/spec/node_spec.rb index 4e9a5bc..1612510 100644 --- a/spec/node_spec.rb +++ b/spec/node_spec.rb @@ -169,17 +169,17 @@ describe Zorglub do end it 'partial should render correctly' do - expect(Node0.partial({}, :do_partial, 1, 2)).to eq 'partial_content' + expect(Node0.partial(:do_partial, 1, 2)).to eq 'partial_content' end it 'method level view should work' do - expect(Node0.partial({}, :other_view)).to eq 'partial_content' + expect(Node0.partial(:other_view)).to eq 'partial_content' end it 'partial with hooks should be default' do Node3.before = 0 Node3.after = 0 - expect(Node3.partial({}, :do_partial, 1, 2)).to eq 'partial_content' + expect(Node3.partial(:do_partial, 1, 2)).to eq 'partial_content' expect(Node3.before).to eq 1 expect(Node3.after).to eq 1 end @@ -187,7 +187,7 @@ describe Zorglub do it 'partial without hooks should work' do Node3.before = 0 Node3.after = 0 - expect(Node3.partial({ no_hooks: true }, :do_partial, 1, 2)).to eq 'partial_content' + expect(Node3.partial(:do_partial, 1, 2, no_hooks: true)).to eq 'partial_content' expect(Node3.before).to eq 0 expect(Node3.after).to eq 0 end |
