aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/caching_test.rb7
-rw-r--r--actionpack/test/controller/url_rewriter_test.rb5
-rw-r--r--actionpack/test/dispatch/routing_test.rb4
3 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index 2be91893d4..a3c8fdbb6e 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -63,8 +63,7 @@ class PageCachingTest < ActionController::TestCase
@controller = PageCachingTestController.new
@controller.cache_store = :file_store, FILE_STORE_PATH
- @params = {:controller => 'posts', :action => 'index', :only_path => true, :skip_relative_url_root => true}
- @rewriter = ActionController::UrlRewriter
+ @params = {:controller => 'posts', :action => 'index', :only_path => true}
FileUtils.rm_rf(File.dirname(FILE_STORE_PATH))
FileUtils.mkdir_p(FILE_STORE_PATH)
@@ -82,9 +81,9 @@ class PageCachingTest < ActionController::TestCase
match '/', :to => 'posts#index', :as => :main
end
@params[:format] = 'rss'
- assert_equal '/posts.rss', @rewriter.rewrite(@router, @params)
+ assert_equal '/posts.rss', @router.url_for(@params)
@params[:format] = nil
- assert_equal '/', @rewriter.rewrite(@router, @params)
+ assert_equal '/', @router.url_for(@params)
end
end
diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb
index 3bc8bec3fb..7b46a48a1d 100644
--- a/actionpack/test/controller/url_rewriter_test.rb
+++ b/actionpack/test/controller/url_rewriter_test.rb
@@ -1,8 +1,6 @@
require 'abstract_unit'
require 'controller/fake_controllers'
-ActionController::UrlRewriter
-
class UrlRewriterTests < ActionController::TestCase
class Rewriter
def initialize(request)
@@ -13,8 +11,7 @@ class UrlRewriterTests < ActionController::TestCase
end
def rewrite(router, options)
- options = @options.merge(options)
- ActionController::UrlRewriter.rewrite(router, options)
+ router.url_for(@options.merge(options))
end
end
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index b46276c453..f5fcf9b0df 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -15,6 +15,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
stub_controllers do |routes|
Routes = routes
Routes.draw do
+ default_url_options :host => "rubyonrails.org"
+
controller :sessions do
get 'login' => :new, :as => :login
post 'login' => :create
@@ -189,6 +191,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
assert_equal '/login', url_for(:controller => 'sessions', :action => 'create', :only_path => true)
assert_equal '/login', url_for(:controller => 'sessions', :action => 'new', :only_path => true)
+
+ assert_equal 'http://rubyonrails.org/login', Routes.url_for(:controller => 'sessions', :action => 'create')
end
end