diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-06-07 18:30:18 -0400 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-06-07 18:30:18 -0400 |
commit | a16fd961310d4df5bd20df5fe64b2f764d8aa471 (patch) | |
tree | 0e54acc2ae35e985cd8c8175f051e281acbd4595 /railties/test | |
parent | 735027e58d3000bd5d939e39deabfecef83ee20c (diff) | |
parent | d6953cbfd3b6e06eceba715c60e288b6d7db0d49 (diff) | |
download | rails-a16fd961310d4df5bd20df5fe64b2f764d8aa471.tar.gz rails-a16fd961310d4df5bd20df5fe64b2f764d8aa471.tar.bz2 rails-a16fd961310d4df5bd20df5fe64b2f764d8aa471.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 4 | ||||
-rw-r--r-- | railties/test/application/middleware_test.rb | 6 | ||||
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index fadcc4c025..35ea2729d3 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -47,7 +47,7 @@ module ApplicationTests test "if there's no config.active_support.bare, all of ActiveSupport is required" do use_frameworks [] require "#{app_path}/config/environment" - assert_nothing_raised { [1,2,3].random_element } + assert_nothing_raised { [1,2,3].sample } end test "config.active_support.bare does not require all of ActiveSupport" do @@ -57,7 +57,7 @@ module ApplicationTests Dir.chdir("#{app_path}/app") do require "#{app_path}/config/environment" - assert_raises(NoMethodError) { [1,2,3].random_element } + assert_raises(NoMethodError) { [1,2,3].sample } end end diff --git a/railties/test/application/middleware_test.rb b/railties/test/application/middleware_test.rb index bab17d8af5..aa75fed793 100644 --- a/railties/test/application/middleware_test.rb +++ b/railties/test/application/middleware_test.rb @@ -57,6 +57,12 @@ module ApplicationTests assert !middleware.include?("ActionDispatch::Static") end + test "can delete a middleware from the stack" do + add_to_config "config.middleware.delete ActionDispatch::Static" + boot! + assert !middleware.include?("ActionDispatch::Static") + end + test "removes show exceptions if action_dispatch.show_exceptions is disabled" do add_to_config "config.action_dispatch.show_exceptions = false" boot! diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 6f4c5d77f3..b46ac0efaf 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -232,7 +232,7 @@ Module.new do require_environment = "-r #{environment}" end - `#{Gem.ruby} #{require_environment} #{RAILS_FRAMEWORK_ROOT}/bin/rails #{tmp_path('app_template')}` + `#{Gem.ruby} #{require_environment} #{RAILS_FRAMEWORK_ROOT}/bin/rails new #{tmp_path('app_template')}` File.open("#{tmp_path}/app_template/config/boot.rb", 'w') do |f| if require_environment f.puts "Dir.chdir('#{File.dirname(environment)}') do" |