aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/configuration_test.rb16
-rw-r--r--railties/test/application/middleware_stack_defaults_test.rb2
-rw-r--r--railties/test/application/paths_test.rb1
-rw-r--r--railties/test/application/url_generation_test.rb2
4 files changed, 19 insertions, 2 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 68ca2acaad..90f2e2b370 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -234,6 +234,22 @@ module ApplicationTests
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'
+ end
+
+ class ::OmgController < ActionController::Base
+ def index
+ cookies.signed[:some_key] = "some_value"
+ render :text => env["action_dispatch.secret_token"]
+ end
+ end
+
+ get "/"
+ assert_equal 'ThisIsASECRET123', last_response.body
+ end
+
test "protect from forgery is the default in a new app" do
make_basic_app
diff --git a/railties/test/application/middleware_stack_defaults_test.rb b/railties/test/application/middleware_stack_defaults_test.rb
index 284f7e2e5b..f31ca01fbf 100644
--- a/railties/test/application/middleware_stack_defaults_test.rb
+++ b/railties/test/application/middleware_stack_defaults_test.rb
@@ -10,7 +10,7 @@ class MiddlewareStackDefaultsTest < Test::Unit::TestCase
Object.const_set(:MyApplication, Class.new(Rails::Application))
MyApplication.class_eval do
- config.cookie_secret = "3b7cd727ee24e8444053437c36cc66c4"
+ config.secret_token = "3b7cd727ee24e8444053437c36cc66c4"
config.session_store :cookie_store, :key => "_myapp_session"
end
end
diff --git a/railties/test/application/paths_test.rb b/railties/test/application/paths_test.rb
index 589e515d05..5ab558c026 100644
--- a/railties/test/application/paths_test.rb
+++ b/railties/test/application/paths_test.rb
@@ -71,6 +71,7 @@ module ApplicationTests
assert_in_load_path "lib"
assert_in_load_path "vendor"
+ assert_not_in_load_path "app", "views"
assert_not_in_load_path "app", "metal"
assert_not_in_load_path "config"
assert_not_in_load_path "config", "locales"
diff --git a/railties/test/application/url_generation_test.rb b/railties/test/application/url_generation_test.rb
index 04f5454e09..72cae23985 100644
--- a/railties/test/application/url_generation_test.rb
+++ b/railties/test/application/url_generation_test.rb
@@ -14,7 +14,7 @@ module ApplicationTests
require "action_controller/railtie"
class MyApp < Rails::Application
- config.cookie_secret = "3b7cd727ee24e8444053437c36cc66c4"
+ config.secret_token = "3b7cd727ee24e8444053437c36cc66c4"
config.session_store :cookie_store, :key => "_myapp_session"
end