Sha256: aebff18f8920d5bba9543a84a2c7ead05e0e35301c273c22f9925e20172218ce

Contents?: true

Size: 870 Bytes

Versions: 5

Compression:

Stored size: 870 Bytes

Contents

require 'spec_helper'

describe Document do
  subject { Document }

  describe "ready?" do
    it "accepts a block" do
      Document.ready? { }
    end
  end

  describe "title" do
    it "gets the document title" do
      Document.title.should be_kind_of(String)
    end
  end

  describe "title=" do
    it "sets the document title" do
      old = Document.title
      Document.title = "foo"
      Document.title.should eq("foo")
      Document.title = old
    end
  end

  describe "head" do
    it "returns the head element as an Element instance" do
      expect(subject.head).to be_kind_of(Element)
      expect(subject.head.tag_name).to eq('head')
    end
  end

  describe "body" do
    it "returns the body element as an Element instance" do
      expect(subject.body).to be_kind_of(Element)
      expect(subject.body.tag_name).to eq('body')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opal-jquery-0.4.0 spec/document_spec.rb
opal-jquery-0.3.0 spec/document_spec.rb
opal-jquery-0.3.0.beta2 spec/document_spec.rb
opal-jquery-0.3.0.beta1 spec/document_spec.rb
opal-jquery-0.2.0 spec/document_spec.rb