summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spec/node_spec.rb6
-rw-r--r--spec/spec_helper.rb10
2 files changed, 16 insertions, 0 deletions
diff --git a/spec/node_spec.rb b/spec/node_spec.rb
index 5c3e2e2..66ff114 100644
--- a/spec/node_spec.rb
+++ b/spec/node_spec.rb
@@ -209,6 +209,12 @@ describe Zorglub do
r.body[0].should == "<h1>Hello world</h1>\n"
end
#
+ it "view_base_path! should work" do
+ r = Node7.my_call '/view_path'
+ h = YAML.load r.body[0]
+ h[:view].should == File.join(Zorglub::Config.root, 'alt/do_render')
+ end
+ #
end
#
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 6a71ef4..4a5a9b2 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -165,6 +165,15 @@ class Node6 < Zorglub::Node
end
end
#
+class Node7 < Zorglub::Node
+ Zorglub::Config.debug=true
+ view_base_path! File.join Zorglub::Config.root, 'alt'
+ def view_path
+ view! 'do_render'
+ end
+end
+
+#
APP = Zorglub::App.new do
map '/node0', Node0
map '/node1', Node1
@@ -172,6 +181,7 @@ APP = Zorglub::App.new do
map '/node4', Node4
map '/node5', Node5
map '/node6', Node6
+ map '/node7', Node7
end
class Node2
map APP, '/node2'