Sha256: caaa9553499ff4a9b9596d001b7f1dd7f0d2273515b796d009294176925d0068

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 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 :dir, :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_not be_nil
            doc.at("script[@src='/specs/foo/failing_spec.js']").should_not be_nil
            doc.at("script[@src='/specs/foo/passing_spec.js']").should_not be_nil
          end

          it "returns the screw unit template" do
            doc.at("link[@href='/core/screw.css']").should_not be_nil
            doc.at("script[@src='/core/screw.builder.js']").should_not be_nil
            doc.at("script[@src='/core/screw.events.js']").should_not be_nil
            doc.at("script[@src='/core/screw.behaviors.js']").should_not be_nil
            doc.at("body/#screw_unit_content").should_not be_nil
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
screw-unit-0.3.3 spec/unit/js_test_core/specs/spec_dir_spec.rb