Sha256: 20a12415ac227fc19ac4cf161fcd8baa071635996b4acc25e0dd16f0f9611633

Contents?: true

Size: 1.45 KB

Versions: 4

Compression:

Stored size: 1.45 KB

Contents

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

module JsTestCore
  module Resources
    module Specs
      describe SpecDir do
        attr_reader :dir

        before do
          stub(EventMachine).send_data
          stub(EventMachine).close_connection
          @dir = SpecDir.new(spec_root_path, '/specs')
        end

        describe "#get" do
          attr_reader :html, :doc
          before do
            request = request('get', '/specs')
            response = Rack::Response.new
            dir.get(request, response)
            @html = response.body
            @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 screw unit template" do
            doc.at("link[@href='/core/screw.css']").should exist
            doc.at("script[@src='/core/screw.builder.js']").should exist
            doc.at("script[@src='/core/screw.events.js']").should exist
            doc.at("script[@src='/core/screw.behaviors.js']").should exist
            doc.at("script[@src='/core/screw.assets.js']").should exist
            doc.at("body/#screw_unit_content").should_not be_nil
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
btakita-screw-unit-server-0.3.0 spec/unit/js_test_core/specs/spec_dir_spec.rb
btakita-screw_unit-0.1.0 spec/unit/js_test_core/specs/spec_dir_spec.rb
btakita-screw_unit-0.3.0 spec/unit/js_test_core/specs/spec_dir_spec.rb
screw-unit-server-0.3.0 spec/unit/js_test_core/specs/spec_dir_spec.rb