spec/musterb/template_handler_spec.rb in musterb-0.1.2 vs spec/musterb/template_handler_spec.rb in musterb-0.2.0
- old
+ new
@@ -11,24 +11,24 @@
binding.eval compile_template(template, options)
end
it "is wired up correctly" do
foo = "hi"
- evaluate("{{foo}}", binding).should eq "hi"
+ evaluate("{{foo}}", binding, :locals => ["foo"]).should eq "hi"
end
it "renders partials corrects" do
compile_template("{{>foo}}").should include "render :partial => 'foo', :locals => {:initial_context => musterb.context}"
end
it "escapes things by default" do
foo = "<br>"
- evaluate("{{foo}}", binding).should eq "<br>"
+ evaluate("{{foo}}", binding, :locals => ["foo"]).should eq "<br>"
end
it "does not escape things in triple staches" do
foo = "<br>"
- evaluate("{{{foo}}}", binding).should eq "<br>"
+ evaluate("{{{foo}}}", binding, :locals => ["foo"]).should eq "<br>"
end
it "can read from instance variables (likely on the controller)" do
@foo = "hello"
evaluate("{{foo}}", binding).should eq "hello"
\ No newline at end of file