Sha256: 44c1840a78b7114183373bc237b2371a611e6e4ff66f16b0b19786d9fd2f3d4e

Contents?: true

Size: 740 Bytes

Versions: 5

Compression:

Stored size: 740 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
    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"
  end

  it "should insert the given DOM node at the end of the element" do
    baz = Document.id 'baz'
    buz = Document.id 'buz'

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opal-jquery-0.0.6 spec/element/append_spec.rb
opal-jquery-0.0.5 spec/element/append_spec.rb
opal-jquery-0.0.4 spec/element/append_spec.rb
opal-jquery-0.0.3 spec/element/append_spec.rb
opal-jquery-0.0.2 spec/element/append_spec.rb