spec/unit/arbre/html/element_spec.rb in andrewroth_activeadmin-0.3.4.3 vs spec/unit/arbre/html/element_spec.rb in andrewroth_activeadmin-0.3.4.4
- old
+ new
@@ -71,11 +71,11 @@
context "when the child is a string" do
let(:child){ "Hello World" }
it "should add as a TextNode" do
element.children.first.should be_instance_of(Arbre::HTML::TextNode)
- element.children.first.to_html.should == "Hello World"
+ element.children.first.to_s.should == "Hello World"
end
end
end
describe "setting the content" do
@@ -88,17 +88,17 @@
it "should clear the existing children" do
element.children.size.should == 1
end
it "should add the string as a child" do
- element.children.first.to_html.should == "Goodbye"
+ element.children.first.to_s.should == "Goodbye"
end
it "should html escape the string" do
string = "Goodbye <br />"
element.content = string
- element.content.to_html.should == "Goodbye <br />"
+ element.to_s.should == "Goodbye <br />"
end
end
context "when a tag" do
before do
@@ -144,11 +144,11 @@
end
end
describe "rendering to html" do
it "should render the children collection" do
- element.children.should_receive(:to_html).and_return("content")
- element.to_html.should == "content"
+ element.children.should_receive(:to_s).and_return("content")
+ element.to_s.should == "content"
end
end
describe "adding elements together" do