Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8880

Show
Ignore:
Timestamp:
02/16/08 03:08:05 (7 months ago)
Author:
nzkoz
Message:

Sort files to test to make load order platform independent. Fix the clash this exposes. Closees #11081 [tpope]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/Rakefile

    r8491 r8880  
    2727Rake::TestTask.new(:test_action_pack) { |t| 
    2828  t.libs << "test" 
    29 # make sure we include the controller tests (c*) first as on some systems 
     29# make sure we include the tests in alphabetical order as on some systems 
    3030# this will not happen automatically and the tests (as a whole) will error 
    31   t.test_files=Dir.glob( "test/c*/**/*_test.rb" ) + Dir.glob( "test/[ft]*/*_test.rb" ) 
     31  t.test_files=Dir.glob( "test/[cft]*/**/*_test.rb" ).sort 
    3232#  t.pattern = 'test/*/*_test.rb' 
    3333  t.verbose = true 
  • trunk/actionpack/test/controller/polymorphic_routes_test.rb

    r8741 r8880  
    1111end 
    1212 
    13 class Comment < Article 
     13class Response < Article 
    1414  def post_id; 1 end 
    1515end 
    1616 
    1717class Tag < Article 
    18   def comment_id; 1 end 
     18  def response_id; 1 end 
    1919end 
    2020 
    2121# TODO: test nested models 
    22 class Comment::Nested < Comment; end 
     22class Response::Nested < Response; end 
    2323 
    2424uses_mocha 'polymorphic URL helpers' do 
     
    2929    def setup 
    3030      @article = Article.new 
    31       @comment = Comment.new 
     31      @response = Response.new 
    3232    end 
    3333   
     
    7474 
    7575    def test_with_nested 
    76       @comment.save 
    77       expects(:article_comment_url).with(@article, @comment
    78       polymorphic_url([@article, @comment]) 
     76      @response.save 
     77      expects(:article_response_url).with(@article, @response
     78      polymorphic_url([@article, @response]) 
    7979    end 
    8080 
    8181    def test_with_nested_unsaved 
    82       expects(:article_comments_url).with(@article) 
    83       polymorphic_url([@article, @comment]) 
     82      expects(:article_responses_url).with(@article) 
     83      polymorphic_url([@article, @response]) 
    8484    end 
    8585 
     
    9898      expects(:admin_article_url).with(@article) 
    9999      polymorphic_url([:admin, @article]) 
    100       expects(:admin_article_comments_url).with(@article) 
    101       polymorphic_url([:admin, @article, @comment]) 
     100      expects(:admin_article_responses_url).with(@article) 
     101      polymorphic_url([:admin, @article, @response]) 
    102102    end 
    103103 
    104104    def test_nested_with_array_and_namespace 
    105       @comment.save 
    106       expects(:admin_article_comment_url).with(@article, @comment
    107       polymorphic_url([:admin, @article, @comment]) 
     105      @response.save 
     106      expects(:admin_article_response_url).with(@article, @response
     107      polymorphic_url([:admin, @article, @response]) 
    108108 
    109109      # a ridiculously long named route tests correct ordering of namespaces and nesting: 
    110110      @tag = Tag.new 
    111111      @tag.save 
    112       expects(:site_admin_article_comment_tag_url).with(@article, @comment, @tag) 
    113       polymorphic_url([:site, :admin, @article, @comment, @tag]) 
     112      expects(:site_admin_article_response_tag_url).with(@article, @response, @tag) 
     113      polymorphic_url([:site, :admin, @article, @response, @tag]) 
    114114    end 
    115115