Permalink
Browse files

Fixed double-singularization on scaffolded pagination call (Address w…

…ould be turned into Addres) #1216, #1404 [nilsga]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1422 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent ac1fa98 commit cb79118111f7d4354b946dc9f2bed6a57dc81956 @dhh dhh committed Jun 15, 2005
@@ -1,5 +1,7 @@
*SVN*
+* Fixed double-singularization on scaffolded pagination call (Address would be turned into Addres) #1216, #1404 [nilsga]
+
* Removed the require hack used by functional testing to work around an earlier bug in rake.
* Allow distance_of_time_in_words to work with any value that responds to #to_time (like dates) #969
@@ -99,7 +99,7 @@ def index
module_eval <<-"end_eval", __FILE__, __LINE__
def list#{suffix}
- @#{singular_name}_pages, @#{plural_name} = paginate :#{singular_name}, :per_page => 10
+ @#{singular_name}_pages, @#{plural_name} = paginate :#{plural_name}, :per_page => 10
render#{suffix}_scaffold "list#{suffix}"
end
@@ -0,0 +1,45 @@
+require File.dirname(__FILE__) + '/../abstract_unit'
+
+class Address
+
+ def Address.count(conditions = nil, join = nil)
+ nil
+ end
+
+ def Address.find_all(arg1, arg2, arg3, arg4)
+ []
+ end
+end
+
+class AddressesTestController < ActionController::Base
+
+ scaffold :address
+
+ def self.controller_name; "addresses"; end
+ def self.controller_path; "addresses"; end
+
+end
+
+AddressesTestController.template_root = File.dirname(__FILE__) + "/../fixtures/"
+
+class AddressesTest < Test::Unit::TestCase
+ def setup
+ @controller = AddressesTestController.new
+
+ # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
+ # a more accurate simulation of what happens in "real life".
+ @controller.logger = Logger.new(nil)
+
+ @request = ActionController::TestRequest.new
+ @response = ActionController::TestResponse.new
+
+ @request.host = "www.nextangle.com"
+ end
+
+ def test_list
+ get :list
+ assert_equal "We only need to get this far!", @response.body.chomp
+ end
+
+
+end
@@ -0,0 +1 @@
+We only need to get this far!

0 comments on commit cb79118

Please sign in to comment.