spec/erb_context_spec.rb in spinebox-0.0.13 vs spec/erb_context_spec.rb in spinebox-0.0.14
- old
+ new
@@ -6,33 +6,47 @@
Dir.chdir "#{Spinebox.root}/templates/app"
Spinebox.boot!
end
context "javascript" do
-
it "should offer asset tags concatenated" do
Spinebox.config.concatenate = true
javascript_include_tag("application").split("\n").should have(1).tag
end
it "should offer asset tags unconcatenated" do
Spinebox.config.concatenate = false
javascript_include_tag("application").split("\n").should have_at_least(5).tags
end
-
end
context "css" do
-
it "should offer asset tags concatenated" do
Spinebox.config.concatenate = true
stylesheet_link_tag("application").split("\n").should have(1).tag
end
it "should offer asset tags unconcatenated" do
Spinebox.config.concatenate = false
stylesheet_link_tag("application").split("\n").should have_at_least(1).tag
end
+ end
+
+ context "render", :render do
+ it "returns a rendered partial" do
+ render(:partial => "partial.html").should == "<p>This is a partial</p>"
+ end
+ it "raises an error on missing params" do
+ proc{ render }.should raise_error
+ end
+
+ it "raises an error on missing partial extensions" do
+ proc{ render(:partial => "partial") }.should raise_error
+ end
+
+ it "raises an error on unexistant partial" do
+ proc{ render(:partial => "notthere.html") }.should raise_error
+ end
end
end
\ No newline at end of file