aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-12-08 16:52:26 -0600
committerJoshua Peek <josh@joshpeek.com>2009-12-08 16:52:26 -0600
commit2be5e088d27f17cd7210cbfd227aff2e5be6b800 (patch)
treecfd72dedbc45de1f0e143bc08bf196937c4f31c2 /actionpack/test/template
parentac711043ecec0dd15a159eff8081be8f10584be0 (diff)
downloadrails-2be5e088d27f17cd7210cbfd227aff2e5be6b800.tar.gz
rails-2be5e088d27f17cd7210cbfd227aff2e5be6b800.tar.bz2
rails-2be5e088d27f17cd7210cbfd227aff2e5be6b800.zip
Use new routing dsl in tests
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/atom_feed_helper_test.rb12
-rw-r--r--actionpack/test/template/test_case_test.rb4
-rw-r--r--actionpack/test/template/url_helper_test.rb8
3 files changed, 12 insertions, 12 deletions
diff --git a/actionpack/test/template/atom_feed_helper_test.rb b/actionpack/test/template/atom_feed_helper_test.rb
index 6a5fb0acff..347cb98303 100644
--- a/actionpack/test/template/atom_feed_helper_test.rb
+++ b/actionpack/test/template/atom_feed_helper_test.rb
@@ -187,10 +187,9 @@ class ScrollsController < ActionController::Base
end
protected
-
- def rescue_action(e)
- raise(e)
- end
+ def rescue_action(e)
+ raise(e)
+ end
end
class AtomFeedTest < ActionController::TestCase
@@ -311,11 +310,12 @@ class AtomFeedTest < ActionController::TestCase
assert_select "summary div p", :text => "after 2"
end
end
-private
+
+ private
def with_restful_routing(resources)
with_routing do |set|
set.draw do |map|
- map.resources(resources)
+ resources(resources)
end
yield
end
diff --git a/actionpack/test/template/test_case_test.rb b/actionpack/test/template/test_case_test.rb
index 05a409d05a..9a448ce328 100644
--- a/actionpack/test/template/test_case_test.rb
+++ b/actionpack/test/template/test_case_test.rb
@@ -114,7 +114,7 @@ module ActionView
test "is able to use named routes" do
with_routing do |set|
- set.draw { |map| map.resources :contents }
+ set.draw { |map| resources :contents }
assert_equal 'http://test.host/contents/new', new_content_url
assert_equal 'http://test.host/contents/1', content_url(:id => 1)
end
@@ -122,7 +122,7 @@ module ActionView
test "named routes can be used from helper included in view" do
with_routing do |set|
- set.draw { |map| map.resources :contents }
+ set.draw { |map| resources :contents }
_helpers.module_eval do
def render_from_helper
new_content_url
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 5c463a4f60..d4b58efe1e 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -451,7 +451,7 @@ class UrlHelperControllerTest < ActionController::TestCase
def with_url_helper_routing
with_routing do |set|
set.draw do |map|
- map.show_named_route 'url_helper_controller_test/url_helper/show_named_route', :controller => 'url_helper_controller_test/url_helper', :action => 'show_named_route'
+ match 'url_helper_controller_test/url_helper/show_named_route', :to => 'url_helper_controller_test/url_helper#show_named_route', :as => :show_named_route
end
yield
end
@@ -505,7 +505,7 @@ class LinkToUnlessCurrentWithControllerTest < ActionController::TestCase
def with_restful_routing
with_routing do |set|
set.draw do |map|
- map.resources :tasks
+ resources :tasks
end
yield
end
@@ -625,8 +625,8 @@ class PolymorphicControllerTest < ActionController::TestCase
def with_restful_routing
with_routing do |set|
set.draw do |map|
- map.resources :workshops do |w|
- w.resources :sessions
+ resources :workshops do
+ resources :sessions
end
end
yield