Sha256: 0d56375f1e1976ad04b0eaa50e64be9c777f06bd724773550a227768bdfcb860

Contents?: true

Size: 749 Bytes

Versions: 16

Compression:

Stored size: 749 Bytes

Contents

require "spec_helper"

describe "Element#append" do
  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

  it "should insert the HTML string to the end of each element" do
    Element.find('.first-append').append '<p class="woosh"></p>'

    Element.find('#foo').children.class_name.should == "woosh"
    Element.find('#bar').children.class_name.should == "woosh"
  end

  it "should insert the given DOM node at the end of the element" do
    baz = Element.find('#baz')
    buz = Element.find('#buz')

    baz.children.size.should == 0
    baz.append buz

    baz.children.size.should == 1
    baz.children.id.should == "buz"
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
opal-jquery-0.4.2 spec/element/append_spec.rb
opal-jquery-0.4.1 spec/element/append_spec.rb
opal-jquery-0.4.0 spec/element/append_spec.rb
opal-jquery-0.3.0 spec/element/append_spec.rb
opal-jquery-0.3.0.beta2 spec/element/append_spec.rb
opal-jquery-0.3.0.beta1 spec/element/append_spec.rb
opal-jquery-0.2.0 spec/element/append_spec.rb
opal-jquery-0.1.2 spec/element/append_spec.rb
opal-jquery-0.1.1 spec/element/append_spec.rb
opal-jquery-0.1.0 spec/element/append_spec.rb
opal-jquery-0.0.13 spec/element/append_spec.rb
opal-jquery-0.0.12 spec/element/append_spec.rb
opal-jquery-0.0.11 spec/element/append_spec.rb
opal-jquery-0.0.9 spec/element/append_spec.rb
opal-jquery-0.0.8 spec/element/append_spec.rb
opal-jquery-0.0.7 spec/element/append_spec.rb