From f1f2753a22edbc8ccfd6e02fe762bff7f0cf69ef Mon Sep 17 00:00:00 2001
From: Shane Tomlinson <stomlinson@mozilla.com>
Date: Thu, 14 Jun 2012 11:13:01 +0100
Subject: [PATCH] Create a mock cachify for the front end tests.

---
 resources/static/test/mocks/cachify.js | 15 +++++++++++++++
 resources/views/test.ejs               |  1 +
 2 files changed, 16 insertions(+)
 create mode 100644 resources/static/test/mocks/cachify.js

diff --git a/resources/static/test/mocks/cachify.js b/resources/static/test/mocks/cachify.js
new file mode 100644
index 000000000..7f95a7aa4
--- /dev/null
+++ b/resources/static/test/mocks/cachify.js
@@ -0,0 +1,15 @@
+/*jshint browsers:true, forin: true, laxbreak: true */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+window.cachify = (function() {
+  "use strict";
+
+  // cachify is a node module used for caching resources, as such it is not
+  // available to the client. The main site makes use of cachify in its
+  // templates to serve up cached resources.  The front end unit tests write
+  // the main site templates to the DOM to run.  Create a mock cachify so the
+  // front end unit tests can run.
+  return function(url) { return url; }
+}());
+
diff --git a/resources/views/test.ejs b/resources/views/test.ejs
index 8f6ea43fe..7f05abc23 100644
--- a/resources/views/test.ejs
+++ b/resources/views/test.ejs
@@ -86,6 +86,7 @@
     <script src="mocks/provisioning.js"></script>
     <script src="mocks/window.js"></script>
     <script src="mocks/winchan.js"></script>
+    <script src="mocks/cachify.js"></script>
 
     <script src="/shared/renderer.js"></script>
     <script src="/shared/class.js"></script>
-- 
GitLab