aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-05-28 18:53:00 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-05-28 18:53:00 -0300
commit73aab036eeeb297dc85dc812f54e26aa943f48f7 (patch)
tree4176d0af72d6975483f4b13924608b5bf106d43d /actionpack/test/dispatch
parent233ceda594c19331f493ed1436c8c26b5d1aaf1b (diff)
parent3ff39494cdea67502dbd6465358eca3e14a84d6b (diff)
downloadrails-73aab036eeeb297dc85dc812f54e26aa943f48f7.tar.gz
rails-73aab036eeeb297dc85dc812f54e26aa943f48f7.tar.bz2
rails-73aab036eeeb297dc85dc812f54e26aa943f48f7.zip
Merge pull request #20017 from eliotsykes/configurable-static-index-filename
config.static_index configures directory Index "index.html" filename
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/static_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/static_test.rb b/actionpack/test/dispatch/static_test.rb
index 93e5c85a97..e729cc44f9 100644
--- a/actionpack/test/dispatch/static_test.rb
+++ b/actionpack/test/dispatch/static_test.rb
@@ -57,6 +57,7 @@ module StaticTests
def test_serves_static_index_file_in_directory
assert_html "/foo/index.html", get("/foo/index.html")
+ assert_html "/foo/index.html", get("/foo/index")
assert_html "/foo/index.html", get("/foo/")
assert_html "/foo/index.html", get("/foo")
end
@@ -260,6 +261,19 @@ class StaticTest < ActiveSupport::TestCase
}
assert_equal(DummyApp.call(nil), @app.call(env))
end
+
+ def test_non_default_static_index
+ @app = ActionDispatch::Static.new(DummyApp, @root, "public, max-age=60", "other-index")
+ assert_html "/other-index.html", get("/other-index.html")
+ assert_html "/other-index.html", get("/other-index")
+ assert_html "/other-index.html", get("/")
+ assert_html "/other-index.html", get("")
+ assert_html "/foo/other-index.html", get("/foo/other-index.html")
+ assert_html "/foo/other-index.html", get("/foo/other-index")
+ assert_html "/foo/other-index.html", get("/foo/")
+ assert_html "/foo/other-index.html", get("/foo")
+ end
+
end
class StaticEncodingTest < StaticTest