summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/models/helpers/admin_helper_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/models/helpers/admin_helper_test.rb b/test/models/helpers/admin_helper_test.rb
index 23d9f40..94e9861 100644
--- a/test/models/helpers/admin_helper_test.rb
+++ b/test/models/helpers/admin_helper_test.rb
@@ -1,4 +1,14 @@
1require 'test_helper' 1require 'test_helper'
2 2
3class AdminHelperTest < ActionView::TestCase 3class AdminHelperTest < ActionView::TestCase
4 test "mtime_busted_path appends the file's real mtime as a query param" do
5 path = "/stylesheets/admin.css"
6 expected_mtime = File.mtime(Rails.public_path.join("stylesheets/admin.css")).to_i
7
8 assert_equal "#{path}?v=#{expected_mtime}", mtime_busted_path(path)
9 end
10
11 test "mtime_busted_path raises clearly for a missing file rather than silently omitting the version" do
12 assert_raises(RuntimeError) { mtime_busted_path("/stylesheets/does_not_exist.css") }
13 end
4end 14end