Sha256: b08e9f197643af2b1a381df19ea58b0b1f6e8787e6723e137b9fb0c6097c9a7f
Contents?: true
Size: 742 Bytes
Versions: 16
Compression:
Stored size: 742 Bytes
Contents
require "spec_helper" describe "Element#before" do html <<-HTML <div id="some-header" class="kapow"></div> <div id="foo" class="before-spec-first"></div> <div id="bar" class="before-spec-first"></div> <div id="baz"></div> HTML it "should insert the given html string before each element" do el = Element.find('.before-spec-first') el.size.should == 2 el.before '<p class="woosh"></p>' Element.find('#foo').prev.class_name.should == "woosh" Element.find('#bar').prev.class_name.should == "woosh" end it "should insert the given DOM element before this element" do Element.find('#baz').before Element.find('#some-header') Element.find('#baz').prev.id.should == "some-header" end end
Version data entries
16 entries across 16 versions & 1 rubygems