diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-09-26 11:37:42 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-26 11:37:42 -0500 |
commit | ef58194129a1dc0a96286c271b71455d37712b42 (patch) | |
tree | 8a40025c2bd3d773e80afbeea6478b6102fc8a57 /railties/test | |
parent | dbb32115ef45dd58667e450125deba80d7016341 (diff) | |
download | rails-ef58194129a1dc0a96286c271b71455d37712b42.tar.gz rails-ef58194129a1dc0a96286c271b71455d37712b42.tar.bz2 rails-ef58194129a1dc0a96286c271b71455d37712b42.zip |
Move Rails::Static into ActionDispatch
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/fixtures/public/foo/bar.html | 1 | ||||
-rw-r--r-- | railties/test/fixtures/public/foo/index.html | 1 | ||||
-rw-r--r-- | railties/test/fixtures/public/index.html | 1 | ||||
-rw-r--r-- | railties/test/rack_static_test.rb | 46 |
4 files changed, 0 insertions, 49 deletions
diff --git a/railties/test/fixtures/public/foo/bar.html b/railties/test/fixtures/public/foo/bar.html deleted file mode 100644 index 9a35646205..0000000000 --- a/railties/test/fixtures/public/foo/bar.html +++ /dev/null @@ -1 +0,0 @@ -/foo/bar.html
\ No newline at end of file diff --git a/railties/test/fixtures/public/foo/index.html b/railties/test/fixtures/public/foo/index.html deleted file mode 100644 index 497a2e898f..0000000000 --- a/railties/test/fixtures/public/foo/index.html +++ /dev/null @@ -1 +0,0 @@ -/foo/index.html
\ No newline at end of file diff --git a/railties/test/fixtures/public/index.html b/railties/test/fixtures/public/index.html deleted file mode 100644 index 525950ba6b..0000000000 --- a/railties/test/fixtures/public/index.html +++ /dev/null @@ -1 +0,0 @@ -/index.html
\ No newline at end of file diff --git a/railties/test/rack_static_test.rb b/railties/test/rack_static_test.rb deleted file mode 100644 index 695b011d03..0000000000 --- a/railties/test/rack_static_test.rb +++ /dev/null @@ -1,46 +0,0 @@ -require 'abstract_unit' - -require 'action_controller' -require 'rails/rack' - -class RackStaticTest < ActiveSupport::TestCase - def setup - FileUtils.cp_r "#{RAILS_ROOT}/fixtures/public", "#{RAILS_ROOT}/public" - end - - def teardown - FileUtils.rm_rf "#{RAILS_ROOT}/public" - end - - DummyApp = lambda { |env| - [200, {"Content-Type" => "text/plain"}, ["Hello, World!"]] - } - App = Rails::Rack::Static.new(DummyApp, "#{RAILS_ROOT}/public") - - test "serves dynamic content" do - assert_equal "Hello, World!", get("/nofile") - end - - test "serves static index at root" do - assert_equal "/index.html", get("/index.html") - assert_equal "/index.html", get("/index") - assert_equal "/index.html", get("/") - end - - test "serves static file in directory" do - assert_equal "/foo/bar.html", get("/foo/bar.html") - assert_equal "/foo/bar.html", get("/foo/bar/") - assert_equal "/foo/bar.html", get("/foo/bar") - end - - test "serves static index file in directory" do - assert_equal "/foo/index.html", get("/foo/index.html") - assert_equal "/foo/index.html", get("/foo/") - assert_equal "/foo/index.html", get("/foo") - end - - private - def get(path) - Rack::MockRequest.new(App).request("GET", path).body - end -end |