Sha256: 33a32fa28a8033421ab1281426d9c7289696c8ccfd226710be87901f6634103d

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

require File.expand_path("#{File.dirname(__FILE__)}/../../unit_spec_helper")

module JsTestCore
  module Resources
    module Specs
      describe SpecDir do
        describe "GET /specs" do
          attr_reader :html, :doc
          before do
            mock(connection).send_head
            mock(connection).send_body(anything) do |@html|
              # do nothing
            end

            connection.receive_data("GET /specs HTTP/1.1\r\nHost: _\r\n\r\n")
            @doc = Hpricot(html)
          end

          it "returns script tags for each test javascript file" do
            doc.at("script[@src='/specs/failing_spec.js']").should exist
            doc.at("script[@src='/specs/foo/failing_spec.js']").should exist
            doc.at("script[@src='/specs/foo/passing_spec.js']").should exist
          end

          it "returns the js specs template" do
            doc.at("link[@href='/core/JSSpec.css']").should exist
            doc.at("script[@src='/core/JSSpec.js']").should exist
            doc.at("script[@src='/core/JSSpecExtensions.js']").should exist
            doc.at("body/#js_spec_content").should_not be_nil
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
js_spec-0.3.0 spec/unit/js_test_core/resources/spec_dir_spec.rb
js_spec-0.3.1 spec/unit/js_test_core/resources/spec_dir_spec.rb
js_spec-0.3.2 spec/unit/js_test_core/resources/spec_dir_spec.rb