summaryrefslogtreecommitdiffstats
path: root/spec/node_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-02-01 10:59:17 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-02-01 10:59:17 +0100
commite02cbcfae357acd51811b9ee0ddb353b7b4bb48c (patch)
treecbf08138aed507d29d61c1220a8e010d894ea97d /spec/node_spec.rb
parent8bbadf7b348a41855c557b2bf923b72851c83b98 (diff)
downloadzorglub-e02cbcfae357acd51811b9ee0ddb353b7b4bb48c.zip
zorglub-e02cbcfae357acd51811b9ee0ddb353b7b4bb48c.tar.gz
Node#partial: add first param env, allow by passing hooks
Diffstat (limited to 'spec/node_spec.rb')
-rw-r--r--spec/node_spec.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/node_spec.rb b/spec/node_spec.rb
index 654966f..021aea5 100644
--- a/spec/node_spec.rb
+++ b/spec/node_spec.rb
@@ -167,11 +167,27 @@ describe Zorglub do
end
#
it "partial should render correctly" do
- Node0.partial(:do_partial, 1, 2).should == 'partial_content'
+ Node0.partial({},:do_partial, 1, 2).should == 'partial_content'
end
#
it "method level view should work" do
- Node0.partial(:other_view).should == 'partial_content'
+ Node0.partial({},:other_view).should == 'partial_content'
+ end
+ #
+ it "partial with hooks should be default" do
+ Node3.before = 0
+ Node3.after = 0
+ Node3.partial({},:do_partial,1,2).should == 'partial_content'
+ Node3.before.should == 1
+ Node3.after.should == 1
+ end
+ #
+ it "partial without hooks should work" do
+ Node3.before = 0
+ Node3.after = 0
+ Node3.partial({:no_hooks=>true},:do_partial,1,2).should == 'partial_content'
+ Node3.before.should == 0
+ Node3.after.should == 0
end
#
it "static pages should be generated" do