From 3b6bdfc1050a83c6339421257d60a6163bf3c687 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 8 Oct 2009 14:13:36 -0500 Subject: API change: content_tag_for outputs prefixed class name --- actionpack/test/template/record_tag_helper_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test') 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 = %() + expected = %() actual = content_tag_for(:ul, @post, :archived) { } assert_dom_equal expected, actual end -- cgit v1.2.3 From 7bc5e3bd02632bd3545b9097e14ea289e9531bb5 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 10 Oct 2009 19:53:40 -0500 Subject: Add define a "stuff" controller in fixtures to support routing tests --- actionpack/test/lib/controller/fake_controllers.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/test') diff --git a/actionpack/test/lib/controller/fake_controllers.rb b/actionpack/test/lib/controller/fake_controllers.rb index 9ec7f330b8..54b6e3ba4c 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 -- cgit v1.2.3 From 5d071b4bc28596896b8e51703afe2d0ff44c4143 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 10 Oct 2009 19:58:36 -0500 Subject: Drop implementation specific routing test assertions --- actionpack/test/controller/routing_test.rb | 3 --- 1 file changed, 3 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index edf243337f..32d60d8b7a 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -984,9 +984,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) -- cgit v1.2.3 From 673f73b53822a8a94bac0b6d4ffc485f6eaeb9cd Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 10 Oct 2009 20:04:44 -0500 Subject: Add define another "stuff" controller to support routing tests --- actionpack/test/lib/controller/fake_controllers.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/test') diff --git a/actionpack/test/lib/controller/fake_controllers.rb b/actionpack/test/lib/controller/fake_controllers.rb index 54b6e3ba4c..c993836a61 100644 --- a/actionpack/test/lib/controller/fake_controllers.rb +++ b/actionpack/test/lib/controller/fake_controllers.rb @@ -27,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 -- cgit v1.2.3 From 21be1dcffa98321fc999e39d11e902d717affad1 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 10 Oct 2009 20:16:55 -0500 Subject: Relative url generations are covered more thoroughly by url rewriter tests --- actionpack/test/controller/routing_test.rb | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 32d60d8b7a..f3eef58f46 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' -- cgit v1.2.3 From 1610cd0827129c28518ee6586d8ecf922576bf20 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 10 Oct 2009 20:19:47 -0500 Subject: Move safe buffer into test/template --- actionpack/test/template/safe_buffer_test.rb | 41 ++++++++++++++++++++++++++++ actionpack/test/view/safe_buffer_test.rb | 41 ---------------------------- 2 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 actionpack/test/template/safe_buffer_test.rb delete mode 100644 actionpack/test/view/safe_buffer_test.rb (limited to 'actionpack/test') diff --git a/actionpack/test/template/safe_buffer_test.rb b/actionpack/test/template/safe_buffer_test.rb new file mode 100644 index 0000000000..2236709627 --- /dev/null +++ b/actionpack/test/template/safe_buffer_test.rb @@ -0,0 +1,41 @@ +require 'abstract_unit' + +class SafeBufferTest < ActionView::TestCase + def setup + @buffer = ActionView::SafeBuffer.new + end + + test "Should look like a string" do + assert @buffer.is_a?(String) + assert_equal "", @buffer + end + + test "Should escape a raw string which is passed to them" do + @buffer << "