summaryrefslogtreecommitdiffstats
path: root/spec/node_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2026-02-14 17:33:06 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2026-02-14 17:33:06 +0100
commitde649a45977acf03f9197f6ce9150437bfa53c1c (patch)
tree1791afd166490f3d5d9793a6eec43a3b4323d67d /spec/node_spec.rb
parente1bcb13ef41575021951f0eccc502dd1705dc3d0 (diff)
downloadzorglub-de649a45977acf03f9197f6ce9150437bfa53c1c.zip
zorglub-de649a45977acf03f9197f6ce9150437bfa53c1c.tar.gz
implemente local variables & recursion check in partial
Diffstat (limited to 'spec/node_spec.rb')
-rw-r--r--spec/node_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/node_spec.rb b/spec/node_spec.rb
index 1612510..3aaec55 100644
--- a/spec/node_spec.rb
+++ b/spec/node_spec.rb
@@ -192,6 +192,18 @@ describe Zorglub do
expect(Node3.after).to eq 0
end
+ it 'partial with locals should work' do
+ expect(Node0.partial(:test_locals, locals: { my_local: 'hello' })).to eq 'hello'
+ end
+
+ it 'recursive partial should work' do
+ expect(Node0.partial(:test_recursive, 3)).to eq '3-2-1-end'
+ end
+
+ it 'recursive partial depth limit should be enforced' do
+ expect { Node0.partial(:test_recursive, 25) }.to raise_error('Recursive partial depth limit exceeded')
+ end
+
it 'static pages should be generated' do
r = Node6.my_call '/do_static'
expect(r[2][0]).to eq 'VAL 1'