aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/configuration_test.rb2
-rw-r--r--railties/test/application/generators_test.rb13
-rw-r--r--railties/test/application/middleware_test.rb2
-rw-r--r--railties/test/rails_info_controller_test.rb8
4 files changed, 18 insertions, 7 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 60d644bd59..56f45582c8 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -93,7 +93,7 @@ module ApplicationTests
RUBY
require "#{app_path}/config/application"
- assert AppTemplate::Application.config.action_controller.allow_concurrency
+ assert AppTemplate::Application.config.allow_concurrency
end
test "the application can be marked as threadsafe when there are no frameworks" do
diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb
index e54edea07c..25fa100275 100644
--- a/railties/test/application/generators_test.rb
+++ b/railties/test/application/generators_test.rb
@@ -30,6 +30,7 @@ module ApplicationTests
assert_equal(true, c.generators.colorize_logging)
assert_equal({}, c.generators.aliases)
assert_equal({}, c.generators.options)
+ assert_equal({}, c.generators.fallbacks)
end
end
@@ -51,11 +52,20 @@ module ApplicationTests
end
end
- test "generators aliases and options on initialization" do
+ test "generators set rails fallbacks" do
+ with_config do |c|
+ c.generators.fallbacks[:shoulda] = :test_unit
+ expected = { :shoulda => :test_unit }
+ assert_equal expected, c.generators.fallbacks
+ end
+ end
+
+ test "generators aliases, options and fallbacks on initialization" do
add_to_config <<-RUBY
config.generators.rails :aliases => { :test_framework => "-w" }
config.generators.orm :datamapper
config.generators.test_framework :rspec
+ config.generators.fallbacks[:shoulda] = :test_unit
RUBY
# Initialize the application
@@ -65,6 +75,7 @@ module ApplicationTests
assert_equal :rspec, Rails::Generators.options[:rails][:test_framework]
assert_equal "-w", Rails::Generators.aliases[:rails][:test_framework]
+ assert_equal :test_unit, Rails::Generators.fallbacks[:shoulda]
end
test "generators no color on initialization" do
diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb
index 0b92cdba54..ce9cd510a3 100644
--- a/railties/test/application/middleware_test.rb
+++ b/railties/test/application/middleware_test.rb
@@ -39,7 +39,7 @@ module ApplicationTests
end
test "removes lock if allow concurrency is set" do
- add_to_config "config.action_controller.allow_concurrency = true"
+ add_to_config "config.allow_concurrency = true"
boot!
assert !middleware.include?("Rack::Lock")
end
diff --git a/railties/test/rails_info_controller_test.rb b/railties/test/rails_info_controller_test.rb
index edab27465e..4163fb2c6d 100644
--- a/railties/test/rails_info_controller_test.rb
+++ b/railties/test/rails_info_controller_test.rb
@@ -17,23 +17,23 @@ class InfoControllerTest < ActionController::TestCase
ActionController::Routing::Routes.draw do |map|
match ':controller/:action'
end
- @controller.stubs(:consider_all_requests_local => false, :local_request? => true)
+ @controller.stubs(:consider_all_requests_local? => false, :local_request? => true)
end
test "info controller does not allow remote requests" do
- @controller.stubs(:consider_all_requests_local => false, :local_request? => false)
+ @controller.stubs(:consider_all_requests_local? => false, :local_request? => false)
get :properties
assert_response :forbidden
end
test "info controller renders an error message when request was forbidden" do
- @controller.stubs(:consider_all_requests_local => false, :local_request? => false)
+ @controller.stubs(:consider_all_requests_local? => false, :local_request? => false)
get :properties
assert_select 'p'
end
test "info controller allows requests when all requests are considered local" do
- @controller.stubs(:consider_all_requests_local => true, :local_request? => false)
+ @controller.stubs(:consider_all_requests_local? => true, :local_request? => false)
get :properties
assert_response :success
end