o: ActiveSupport::Cache::Entry	:@compressedF:@expires_in0:@created_atf1367990551.672398:@value"!{I"
class:EFI"BundledAsset;�FI"logical_path;�FI" teabag/base/fixture_spec.js;�TI"
pathname;�FI"V/Users/jejacks0n/Projects/teabag/spec/javascripts/teabag/base/fixture_spec.coffee;�FI"content_type;�FI"application/javascript;�FI"
mtime;�FI"2013-01-21T15:52:04-07:00;�FI"length;�Fi?I"digest;�F"%3164ee8be67b47468bf636afd185e2dcI"source;�FI"?(function() {
  describe("Teabag.fixture", function() {
    beforeEach(function() {
      var e;

      fixture.cache = {};
      fixture.cleanup();
      this.mockXhr = {
        readyState: 4,
        status: 200,
        responseText: "_content_",
        getResponseHeader: function() {
          return "_type_";
        },
        open: function() {},
        send: function() {}
      };
      this.xhrSpy = spyOn(this.mockXhr, 'open');
      this.xhrSpy;
      try {
        return spyOn(window, 'XMLHttpRequest').andReturn(this.mockXhr);
      } catch (_error) {
        e = _error;
        return spyOn(window, 'ActiveXObject').andReturn(this.mockXhr);
      }
    });
    describe("@load", function() {
      it("loads all of the files requested", function() {
        fixture.load("fixture.html", "fixture.json");
        expect(this.xhrSpy).toHaveBeenCalledWith("GET", "/teabag/fixtures/fixture.html", false);
        return expect(this.xhrSpy).toHaveBeenCalledWith("GET", "/teabag/fixtures/fixture.json", false);
      });
      it("caches the type/contents of those files", function() {
        fixture.load("fixture.html");
        this.mockXhr.onreadystatechange();
        return expect(fixture.cache["fixture.html"]).toEqual({
          type: "_type_",
          content: "_content_"
        });
      });
      it("throws an exception if unable to load a file", function() {
        var _this = this;

        fixture.load("foo.html");
        this.mockXhr.status = 500;
        return expect(function() {
          return _this.mockXhr.onreadystatechange();
        }).toThrow("Unable to load fixture \"foo.html\".");
      });
      it("adds the contents of files to a fixture element", function() {
        fixture.load("fixture.html");
        this.mockXhr.onreadystatechange();
        expect(document.getElementById("teabag-fixtures").tagName).toBe("DIV");
        expect(document.getElementById("teabag-fixtures").innerHTML).toBe("_content_");
        return expect(document.getElementById("teabag-fixtures")).toBe(fixture.el);
      });
      it("allows appending file contents to the fixture element", function() {
        fixture.load("fixture.html1");
        this.mockXhr.onreadystatechange();
        expect(document.getElementById("teabag-fixtures").tagName).toBe("DIV");
        expect(document.getElementById("teabag-fixtures").innerHTML).toBe("_content_");
        fixture.load("fixture.html2", true);
        this.mockXhr.onreadystatechange();
        expect(document.getElementById("teabag-fixtures").innerHTML).toBe("_content__content_");
        fixture.load("fixture.html3", false);
        this.mockXhr.onreadystatechange();
        return expect(document.getElementById("teabag-fixtures").innerHTML).toBe("_content_");
      });
      return it("handles JSON fixtures", function() {
        this.mockXhr.responseText = '{"foo": "bar"}';
        this.mockXhr.getResponseHeader = function() {
          return "application/json; encoding-blah";
        };
        fixture.load("fixture.json");
        this.mockXhr.onreadystatechange();
        expect(fixture.json.length).toBe(1);
        return expect(fixture.json[0]).toEqual({
          foo: "bar"
        });
      });
    });
    describe("@set", function() {
      it("adds all the contents passed to a fixture element", function() {
        fixture.set("_content1_", "_content2_");
        expect(document.getElementById("teabag-fixtures").tagName).toBe("DIV");
        return expect(document.getElementById("teabag-fixtures").innerHTML).toBe("_content1__content2_");
      });
      return it("allows appending contents to the fixture element", function() {
        fixture.set("_content1_");
        expect(document.getElementById("teabag-fixtures").tagName).toBe("DIV");
        expect(document.getElementById("teabag-fixtures").innerHTML).toBe("_content1_");
        fixture.set("_content2_", true);
        expect(document.getElementById("teabag-fixtures").innerHTML).toBe("_content1__content2_");
        fixture.set("_content3_", false);
        return expect(document.getElementById("teabag-fixtures").innerHTML).toBe("_content3_");
      });
    });
    return describe("@preload", function() {
      it("loads all of the files requested", function() {
        fixture.preload("fixture.html", "fixture.json");
        expect(this.xhrSpy).toHaveBeenCalledWith("GET", "/teabag/fixtures/fixture.html", false);
        return expect(this.xhrSpy).toHaveBeenCalledWith("GET", "/teabag/fixtures/fixture.json", false);
      });
      expect(document.getElementById("teabag-fixtures")).toBe(null);
      return it("caches the type/contents of those files", function() {
        fixture.preload("fixture.html");
        this.mockXhr.onreadystatechange();
        return expect(fixture.cache["fixture.html"]).toEqual({
          type: "_type_",
          content: "_content_"
        });
      });
    });
  });

}).call(this);
;�FI"required_assets_digest;�F"%99e0cdb5689f15e270d3d1d5d4ac4bdfI"
_version;�F"%6776f581a4329e299531e1d52aa59832