aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-02-25 17:51:56 -0800
committerCarlhuda <carlhuda@engineyard.com>2010-02-25 17:53:30 -0800
commit8760add31a0415b4635059cf7fadabc26946c0c2 (patch)
treef8f9466fad7ab23b9a3321c7d5adcad7f7421124 /actionpack/test
parentfc4582fb6684ce72f5628629ea7d061659b790f8 (diff)
downloadrails-8760add31a0415b4635059cf7fadabc26946c0c2.tar.gz
rails-8760add31a0415b4635059cf7fadabc26946c0c2.tar.bz2
rails-8760add31a0415b4635059cf7fadabc26946c0c2.zip
Get URL helpers working again in integration tests.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/integration_test.rb24
1 files changed, 7 insertions, 17 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 29531d237a..1611a549fd 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -75,23 +75,6 @@ class SessionTest < Test::Unit::TestCase
@session.delete_via_redirect(path, args, headers)
end
- def test_url_for_with_controller
- options = {:action => 'show'}
- mock_controller = mock()
- mock_controller.expects(:url_for).with(options).returns('/show')
- @session.stubs(:controller).returns(mock_controller)
- assert_equal '/show', @session.url_for(options)
- end
-
- def test_url_for_without_controller
- options = {:action => 'show'}
- mock_rewriter = mock()
- mock_rewriter.expects(:rewrite).with(SharedTestRoutes, options).returns('/show')
- @session.stubs(:generic_url_rewriter).returns(mock_rewriter)
- @session.stubs(:controller).returns(nil)
- assert_equal '/show', @session.url_for(options)
- end
-
def test_get
path = "/index"; params = "blah"; headers = {:location => 'blah'}
@session.expects(:process).with(:get,path,params,headers)
@@ -238,6 +221,8 @@ class IntegrationTestUsesCorrectClass < ActionController::IntegrationTest
end
class IntegrationProcessTest < ActionController::IntegrationTest
+ include SharedTestRoutes.named_url_helpers
+
class IntegrationController < ActionController::Base
def get
respond_to do |format|
@@ -410,12 +395,17 @@ class IntegrationProcessTest < ActionController::IntegrationTest
match ':action', :to => controller
get 'get/:action', :to => controller
end
+
+ self.metaclass.send(:include, set.named_url_helpers)
+
yield
end
end
end
class MetalIntegrationTest < ActionController::IntegrationTest
+ include SharedTestRoutes.named_url_helpers
+
class Poller
def self.call(env)
if env["PATH_INFO"] =~ /^\/success/