spec/element/append_spec.rb in opal-jquery-0.0.1 vs spec/element/append_spec.rb in opal-jquery-0.0.2
- old
+ new
@@ -1,23 +1,15 @@
+require "spec_helper"
+
describe "Element#append" do
- before do
- @div = Document.parse <<-HTML
- <div id="append-spec">
- <div id="foo" class="first-append"></div>
- <div id="bar" class="first-append"></div>
- <div id="baz"></div>
- <div id="buz"></div>
- </div>
- HTML
+ html <<-HTML
+ <div id="foo" class="first-append"></div>
+ <div id="bar" class="first-append"></div>
+ <div id="baz"></div>
+ <div id="buz"></div>
+ HTML
- @div.append_to_body
- end
-
- after do
- @div.remove
- end
-
it "should insert the HTML string to the end of each element" do
Document.find('.first-append').append '<p class="woosh"></p>'
Document.id('foo').children.class_name.should == "woosh"
Document.id('bar').children.class_name.should == "woosh"
@@ -31,6 +23,6 @@
baz.append buz
baz.children.size.should == 1
baz.children.id.should == "buz"
end
-end
\ No newline at end of file
+end