aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-10-13 15:06:43 -0300
committerEmilio Tagua <miloops@gmail.com>2009-10-13 15:06:43 -0300
commit991d1bc200d6fdc379bc83610bc92a4e220c669e (patch)
tree84ace4c9c117ba7bc82824dbddf15485a9305bd2 /actionpack/test
parent0cf4662ec589813c4fdc22de3398730cab05c5ed (diff)
parent9cd50e7752650a3d6bf8545b51d50619d6e70c0b (diff)
downloadrails-991d1bc200d6fdc379bc83610bc92a4e220c669e.tar.gz
rails-991d1bc200d6fdc379bc83610bc92a4e220c669e.tar.bz2
rails-991d1bc200d6fdc379bc83610bc92a4e220c669e.zip
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/routing_test.rb28
-rw-r--r--actionpack/test/lib/controller/fake_controllers.rb2
-rw-r--r--actionpack/test/template/record_tag_helper_test.rb2
-rw-r--r--actionpack/test/template/safe_buffer_test.rb (renamed from actionpack/test/view/safe_buffer_test.rb)2
4 files changed, 4 insertions, 30 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index edf243337f..7c88520bac 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -240,18 +240,6 @@ class LegacyRouteSetTests < Test::Unit::TestCase
x.send(:home_url))
end
- def test_basic_named_route_with_relative_url_root
- rs.draw do |map|
- map.home '', :controller => 'content', :action => 'list'
- end
- x = setup_for_named_route
- ActionController::Base.relative_url_root = "/foo"
- assert_equal("http://test.host/foo/",
- x.send(:home_url))
- assert_equal "/foo/", x.send(:home_path)
- ActionController::Base.relative_url_root = nil
- end
-
def test_named_route_with_option
rs.draw do |map|
map.page 'page/:title', :controller => 'content', :action => 'show_page'
@@ -307,19 +295,6 @@ class LegacyRouteSetTests < Test::Unit::TestCase
x.send(:users_url))
end
- def test_optimised_named_route_call_never_uses_url_for
- rs.draw do |map|
- map.users 'admin/user', :controller => '/admin/user', :action => 'index'
- map.user 'admin/user/:id', :controller=>'/admin/user', :action=>'show'
- end
- x = setup_for_named_route
- x.expects(:url_for).never
- x.send(:users_url)
- x.send(:users_path)
- x.send(:user_url, 2, :foo=>"bar")
- x.send(:user_path, 3, :bar=>"foo")
- end
-
def test_optimised_named_route_with_host
rs.draw do |map|
map.pages 'pages', :controller => 'content', :action => 'show_page', :host => 'foo.com'
@@ -984,9 +959,6 @@ class RouteSetTest < ActiveSupport::TestCase
end
assert_equal 1, set.routes.size
- route = set.routes.first
-
- assert route.segments.last.optional?
assert_equal '/users/show/10', set.generate(:controller => 'users', :action => 'show', :id => 10)
assert_equal '/users/index/10', set.generate(:controller => 'users', :id => 10)
diff --git a/actionpack/test/lib/controller/fake_controllers.rb b/actionpack/test/lib/controller/fake_controllers.rb
index 9ec7f330b8..c993836a61 100644
--- a/actionpack/test/lib/controller/fake_controllers.rb
+++ b/actionpack/test/lib/controller/fake_controllers.rb
@@ -7,6 +7,7 @@ module Admin
class << self; alias_method :const_available?, :const_defined?; end
class UserController < ActionController::Base; end
class NewsFeedController < ActionController::Base; end
+ class StuffController < ActionController::Base; end
end
module Api
@@ -26,6 +27,7 @@ class HiController < ActionController::Base; end
class ImageController < ActionController::Base; end
class PeopleController < ActionController::Base; end
class SessionsController < ActionController::Base; end
+class StuffController < ActionController::Base; end
class SubpathBooksController < ActionController::Base; end
class WeblogController < ActionController::Base; end
diff --git a/actionpack/test/template/record_tag_helper_test.rb b/actionpack/test/template/record_tag_helper_test.rb
index 77d1374020..1cd18c0692 100644
--- a/actionpack/test/template/record_tag_helper_test.rb
+++ b/actionpack/test/template/record_tag_helper_test.rb
@@ -27,7 +27,7 @@ class RecordTagHelperTest < ActionView::TestCase
end
def test_content_tag_for_prefix
- expected = %(<ul class="post" id="archived_post_45"></ul>)
+ expected = %(<ul class="archived_post" id="archived_post_45"></ul>)
actual = content_tag_for(:ul, @post, :archived) { }
assert_dom_equal expected, actual
end
diff --git a/actionpack/test/view/safe_buffer_test.rb b/actionpack/test/template/safe_buffer_test.rb
index 2236709627..6a18201d16 100644
--- a/actionpack/test/view/safe_buffer_test.rb
+++ b/actionpack/test/template/safe_buffer_test.rb
@@ -26,7 +26,7 @@ class SafeBufferTest < ActionView::TestCase
end
test "Should not mess with a previously escape test" do
- @buffer << CGI.escapeHTML("<script>")
+ @buffer << ERB::Util.html_escape("<script>")
assert_equal "&lt;script&gt;", @buffer
end