diff options
author | José Valim <jose.valim@gmail.com> | 2009-12-27 12:09:20 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-12-27 12:09:20 +0100 |
commit | 47e5caa96bffc04c8c0b287a975a609fb048e530 (patch) | |
tree | 653d360dc9ad7eb7c5d2338840e15ab8b28a902b /railties/test/isolation | |
parent | fd58a2d1da04508a7fdf825143e61d186112e63e (diff) | |
parent | d92c4a84023bc0c8dd75869c9b4d5e50277f4650 (diff) | |
download | rails-47e5caa96bffc04c8c0b287a975a609fb048e530.tar.gz rails-47e5caa96bffc04c8c0b287a975a609fb048e530.tar.bz2 rails-47e5caa96bffc04c8c0b287a975a609fb048e530.zip |
Merge Mail with latest Rails and move mail gem to Gemfile.
Diffstat (limited to 'railties/test/isolation')
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index ba8b35d5cc..ee0a812b47 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -89,6 +89,13 @@ module TestHelpers end end + routes = File.read("#{app_path}/config/routes.rb") + if routes =~ /(\n\s*end\s*)\Z/ + File.open("#{app_path}/config/routes.rb", 'w') do |f| + f.puts $` + "\nmatch ':controller(/:action(/:id))(.:format)'\n" + $1 + end + end + add_to_config 'config.action_controller.session = { :key => "_myapp_session", :secret => "bac838a849c1d5c4de2e6a50af826079" }' end @@ -128,7 +135,7 @@ module TestHelpers def add_to_config(str) environment = File.read("#{app_path}/config/application.rb") - if environment =~ /(\n\s*end\s*)\Z/ + if environment =~ /(\n\s*end\s*end\s*)\Z/ File.open("#{app_path}/config/application.rb", 'w') do |f| f.puts $` + "\n#{str}\n" + $1 end @@ -146,6 +153,14 @@ module TestHelpers app_file("app/controllers/#{name}_controller.rb", contents) end + def use_frameworks(arr) + to_remove = [:actionmailer, + :activemodel, + :activerecord, + :activeresource] - arr + $:.reject! {|path| path =~ %r'/(#{to_remove.join('|')})/' } + end + def boot_rails root = File.expand_path('../../../..', __FILE__) begin |