aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/configuration_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-04-26 09:04:04 +0200
committerJosé Valim <jose.valim@gmail.com>2010-04-26 09:04:04 +0200
commitc9132c149cb9fe5628c2e947434e8c58acdaa709 (patch)
tree116905981963f6eb9feb6d776a603ce7336a973e /railties/test/application/configuration_test.rb
parent2a6e0f34ad6b48dcf41989e0d7555cda46492b34 (diff)
downloadrails-c9132c149cb9fe5628c2e947434e8c58acdaa709.tar.gz
rails-c9132c149cb9fe5628c2e947434e8c58acdaa709.tar.bz2
rails-c9132c149cb9fe5628c2e947434e8c58acdaa709.zip
Refactor tests by moving all middleware tests to the same place.
Diffstat (limited to 'railties/test/application/configuration_test.rb')
-rw-r--r--railties/test/application/configuration_test.rb71
1 files changed, 5 insertions, 66 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 4f1fc3c299..dfc4e2359b 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -109,7 +109,7 @@ module ApplicationTests
end
end
- test "Frameworks are not preloaded by default" do
+ test "frameworks are not preloaded by default" do
require "#{app_path}/config/environment"
assert ActionController.autoload?(:RecordIdentifier)
@@ -193,71 +193,10 @@ module ApplicationTests
assert_equal File.join(app_path, "somewhere"), Rails.public_path
end
- def make_basic_app
- require "rails"
- require "action_controller/railtie"
-
- app = Class.new(Rails::Application)
-
- yield app if block_given?
-
- app.config.session_store :disabled
- app.initialize!
-
- app.routes.draw do
- match "/" => "omg#index"
- end
-
- require 'rack/test'
- extend Rack::Test::Methods
- end
-
- test "config.action_dispatch.x_sendfile_header defaults to ''" do
- make_basic_app
-
- class ::OmgController < ActionController::Base
- def index
- send_file __FILE__
- end
- end
-
- get "/"
- assert_equal File.read(__FILE__), last_response.body
- end
-
- test "config.action_dispatch.x_sendfile_header can be set" do
- make_basic_app do |app|
- app.config.action_dispatch.x_sendfile_header = "X-Sendfile"
- end
-
- class ::OmgController < ActionController::Base
- def index
- send_file __FILE__
- end
- end
-
- get "/"
- assert_equal File.expand_path(__FILE__), last_response.headers["X-Sendfile"]
- end
-
- test "config.action_dispatch.x_sendfile_header is sent to Rack::Sendfile" do
- make_basic_app do |app|
- app.config.action_dispatch.x_sendfile_header = 'X-Lighttpd-Send-File'
- end
-
- class ::OmgController < ActionController::Base
- def index
- send_file __FILE__
- end
- end
-
- get "/"
- assert_equal File.expand_path(__FILE__), last_response.headers["X-Lighttpd-Send-File"]
- end
-
test "config.secret_token is sent in env" do
make_basic_app do |app|
app.config.secret_token = 'ThisIsASECRET123'
+ app.config.session_store :disabled
end
class ::OmgController < ActionController::Base
@@ -287,9 +226,9 @@ module ApplicationTests
end
test "config.action_controller.perform_caching = true" do
- make_basic_app do |app|
- app.config.action_controller.perform_caching = true
- end
+ make_basic_app do |app|
+ app.config.action_controller.perform_caching = true
+ end
class ::OmgController < ActionController::Base
@@count = 0