summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/node_spec.rb20
-rw-r--r--spec/spec_helper.rb4
2 files changed, 22 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
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 4d6740d..3347cf6 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -116,6 +116,10 @@ class Node3 < Zorglub::Node
def index
(Node3.before-Node3.after).should == 1
end
+ def do_partial a1, a2
+ view! Node0.r('do_partial')
+ engine! 'real'
+ end
end
#
class Node8 < Node3