Sha256: b44d6463c93e06bb38f58bb851b1c0b09910fce9373e223374a4364e4a41db5b

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

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

module JsTestCore
  module Resources
    module Specs
      describe SpecFile do
        describe "GET /specs/failing_spec" do
          attr_reader :html, :doc
          before do
            mock(connection).send_head(200, is_a(Hash))
            mock(connection).send_data(/Content-Length:/)
            mock(connection).send_data(anything) do |@html|
              # do nothing
            end

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

          it "returns script tags for the test javascript file" do
            doc.at("script[@src='/specs/failing_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

4 entries across 4 versions & 1 rubygems

Version Path
pivotal-screw-unit-0.4.0 spec/unit/js_test_core/specs/spec_file_spec.rb
pivotal-screw-unit-0.4.1 spec/unit/js_test_core/specs/spec_file_spec.rb
pivotal-screw-unit-0.4.2 spec/unit/js_test_core/specs/spec_file_spec.rb
pivotal-screw-unit-0.4.3 spec/unit/js_test_core/specs/spec_file_spec.rb