aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-02-16 03:08:05 +0000
committerMichael Koziarski <michael@koziarski.com>2008-02-16 03:08:05 +0000
commit1d5ea1857fc0be912b89c4c5032733163da5b31b (patch)
treeee73fcf9286bad2eed14183474911f436c2054c6 /actionpack
parent86cb0a61fb8e07388fdc026530ce113e93f5272d (diff)
downloadrails-1d5ea1857fc0be912b89c4c5032733163da5b31b.tar.gz
rails-1d5ea1857fc0be912b89c4c5032733163da5b31b.tar.bz2
rails-1d5ea1857fc0be912b89c4c5032733163da5b31b.zip
Sort files to test to make load order platform independent. Fix the clash this exposes. Closees #11081 [tpope]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8880 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/Rakefile4
-rw-r--r--actionpack/test/controller/polymorphic_routes_test.rb32
2 files changed, 18 insertions, 18 deletions
diff --git a/actionpack/Rakefile b/actionpack/Rakefile
index 2bf28ff927..eab3d153cd 100644
--- a/actionpack/Rakefile
+++ b/actionpack/Rakefile
@@ -26,9 +26,9 @@ task :test => [:test_action_pack, :test_active_record_integration]
Rake::TestTask.new(:test_action_pack) { |t|
t.libs << "test"
-# make sure we include the controller tests (c*) first as on some systems
+# make sure we include the tests in alphabetical order as on some systems
# this will not happen automatically and the tests (as a whole) will error
- t.test_files=Dir.glob( "test/c*/**/*_test.rb" ) + Dir.glob( "test/[ft]*/*_test.rb" )
+ t.test_files=Dir.glob( "test/[cft]*/**/*_test.rb" ).sort
# t.pattern = 'test/*/*_test.rb'
t.verbose = true
}
diff --git a/actionpack/test/controller/polymorphic_routes_test.rb b/actionpack/test/controller/polymorphic_routes_test.rb
index 660e51334a..90c149a830 100644
--- a/actionpack/test/controller/polymorphic_routes_test.rb
+++ b/actionpack/test/controller/polymorphic_routes_test.rb
@@ -10,16 +10,16 @@ class Article
end
end
-class Comment < Article
+class Response < Article
def post_id; 1 end
end
class Tag < Article
- def comment_id; 1 end
+ def response_id; 1 end
end
# TODO: test nested models
-class Comment::Nested < Comment; end
+class Response::Nested < Response; end
uses_mocha 'polymorphic URL helpers' do
class PolymorphicRoutesTest < Test::Unit::TestCase
@@ -28,7 +28,7 @@ uses_mocha 'polymorphic URL helpers' do
def setup
@article = Article.new
- @comment = Comment.new
+ @response = Response.new
end
def test_with_record
@@ -73,14 +73,14 @@ uses_mocha 'polymorphic URL helpers' do
end
def test_with_nested
- @comment.save
- expects(:article_comment_url).with(@article, @comment)
- polymorphic_url([@article, @comment])
+ @response.save
+ expects(:article_response_url).with(@article, @response)
+ polymorphic_url([@article, @response])
end
def test_with_nested_unsaved
- expects(:article_comments_url).with(@article)
- polymorphic_url([@article, @comment])
+ expects(:article_responses_url).with(@article)
+ polymorphic_url([@article, @response])
end
def test_new_with_array_and_namespace
@@ -97,20 +97,20 @@ uses_mocha 'polymorphic URL helpers' do
@article.save
expects(:admin_article_url).with(@article)
polymorphic_url([:admin, @article])
- expects(:admin_article_comments_url).with(@article)
- polymorphic_url([:admin, @article, @comment])
+ expects(:admin_article_responses_url).with(@article)
+ polymorphic_url([:admin, @article, @response])
end
def test_nested_with_array_and_namespace
- @comment.save
- expects(:admin_article_comment_url).with(@article, @comment)
- polymorphic_url([:admin, @article, @comment])
+ @response.save
+ expects(:admin_article_response_url).with(@article, @response)
+ polymorphic_url([:admin, @article, @response])
# a ridiculously long named route tests correct ordering of namespaces and nesting:
@tag = Tag.new
@tag.save
- expects(:site_admin_article_comment_tag_url).with(@article, @comment, @tag)
- polymorphic_url([:site, :admin, @article, @comment, @tag])
+ expects(:site_admin_article_response_tag_url).with(@article, @response, @tag)
+ polymorphic_url([:site, :admin, @article, @response, @tag])
end
# TODO: Needs to be updated to correctly know about whether the object is in a hash or not