diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-28 18:53:00 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-28 18:53:00 -0300 |
commit | 73aab036eeeb297dc85dc812f54e26aa943f48f7 (patch) | |
tree | 4176d0af72d6975483f4b13924608b5bf106d43d /railties/test/application/middleware | |
parent | 233ceda594c19331f493ed1436c8c26b5d1aaf1b (diff) | |
parent | 3ff39494cdea67502dbd6465358eca3e14a84d6b (diff) | |
download | rails-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 'railties/test/application/middleware')
-rw-r--r-- | railties/test/application/middleware/static_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/railties/test/application/middleware/static_test.rb b/railties/test/application/middleware/static_test.rb index 121c5d3321..1a46cd3568 100644 --- a/railties/test/application/middleware/static_test.rb +++ b/railties/test/application/middleware/static_test.rb @@ -26,5 +26,26 @@ module ApplicationTests assert_not last_response.headers.has_key?('Cache-Control'), "Cache-Control should not be set" end + + test "static_index defaults to 'index'" do + app_file "public/index.html", "/index.html" + + require "#{app_path}/config/environment" + + get '/' + + assert_equal "/index.html\n", last_response.body + end + + test "static_index configurable" do + app_file "public/other-index.html", "/other-index.html" + add_to_config "config.static_index = 'other-index'" + + require "#{app_path}/config/environment" + + get '/' + + assert_equal "/other-index.html\n", last_response.body + end end end |