Sha256: a73ceaf529d7113c9fe98471185d927e3e2ee9007ba9cef66bd1eb939e47558e

Contents?: true

Size: 1.46 KB

Versions: 4

Compression:

Stored size: 1.46 KB

Contents

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

module JsTestCore
  module Resources
    module Specs
      describe SpecFile do
        describe "#spec_files" do
          attr_reader :absolute_path, :relative_path, :file

          before do
            @absolute_path = "#{spec_root_path}/failing_spec.js"
            @relative_path = "/specs/failing_spec.js"
            @file = SpecFile.new(absolute_path, relative_path)
          end

          describe "#get" do
            attr_reader :html, :doc
            before do
              request = request('get', '/specs')
              response = Rack::Response.new
              file.get(request, response)
              @html = response.body
              @doc = Hpricot(html)
            end

            it "returns script tags for the test javascript file" do
              doc.at("script[@src='/specs/failing_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
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_file_spec.rb
btakita-screw_unit-0.1.0 spec/unit/js_test_core/specs/spec_file_spec.rb
btakita-screw_unit-0.3.0 spec/unit/js_test_core/specs/spec_file_spec.rb
screw-unit-server-0.3.0 spec/unit/js_test_core/specs/spec_file_spec.rb