Browse Source

Check if a generated script url has a timestamp when `Asset.timestamp` = force.

Joshua Lückers 8 years ago
parent
commit
1e5f72819c
2 changed files with 14 additions and 0 deletions
  1. 14 0
      tests/TestCase/View/Helper/UrlHelperTest.php
  2. 0 0
      tests/test_app/webroot/js/script.js

+ 14 - 0
tests/TestCase/View/Helper/UrlHelperTest.php

@@ -314,6 +314,20 @@ class UrlHelperTest extends TestCase
     }
 
     /**
+     * Test script and Asset.timestamp = force
+     *
+     * @return void
+     */
+    public function testScriptTimestampForce()
+    {
+        $this->Helper->webroot = '';
+        Configure::write('Asset.timestamp', 'force');
+
+        $result = $this->Helper->script('script.js');
+        $this->assertRegExp('/' . preg_quote(Configure::read('App.jsBaseUrl') . 'script.js?', '/') . '[0-9]+/', $result);
+    }
+
+    /**
      * test image()
      *
      * @return void

tests/test_app/webroot/js/empty → tests/test_app/webroot/js/script.js