Skip to content
This repository
Browse code

Merge pull request #5856 from arunagw/build_fix_master

fix scaffold_generator_test.rb
  • Loading branch information...
commit 039a118857975fa4495a3728d97c65c5d91a8a87 2 parents d97efd9 + ba3e275
Piotr Sarnacki authored April 16, 2012
8  railties/test/generators/model_generator_test.rb
@@ -283,7 +283,7 @@ def test_index_is_added_for_belongs_to_association
283 283
 
284 284
     assert_migration "db/migrate/create_accounts.rb" do |m|
285 285
       assert_method :change, m do |up|
286  
-        assert_match(/add_index/, up)
  286
+        assert_match(/index: true/, up)
287 287
       end
288 288
     end
289 289
   end
@@ -293,7 +293,7 @@ def test_index_is_added_for_references_association
293 293
 
294 294
     assert_migration "db/migrate/create_accounts.rb" do |m|
295 295
       assert_method :change, m do |up|
296  
-        assert_match(/add_index/, up)
  296
+        assert_match(/index: true/, up)
297 297
       end
298 298
     end
299 299
   end
@@ -303,7 +303,7 @@ def test_index_is_skipped_for_belongs_to_association
303 303
 
304 304
     assert_migration "db/migrate/create_accounts.rb" do |m|
305 305
       assert_method :change, m do |up|
306  
-        assert_no_match(/add_index/, up)
  306
+        assert_no_match(/index: true/, up)
307 307
       end
308 308
     end
309 309
   end
@@ -313,7 +313,7 @@ def test_index_is_skipped_for_references_association
313 313
 
314 314
     assert_migration "db/migrate/create_accounts.rb" do |m|
315 315
       assert_method :change, m do |up|
316  
-        assert_no_match(/add_index/, up)
  316
+        assert_no_match(/index: true/, up)
317 317
       end
318 318
     end
319 319
   end
6  railties/test/generators/scaffold_generator_test.rb
@@ -14,10 +14,8 @@ def test_scaffold_on_invoke
14 14
     assert_file "app/models/product_line.rb", /class ProductLine < ActiveRecord::Base/
15 15
     assert_file "test/unit/product_line_test.rb", /class ProductLineTest < ActiveSupport::TestCase/
16 16
     assert_file "test/fixtures/product_lines.yml"
17  
-    assert_migration "db/migrate/create_product_lines.rb", /belongs_to :product/
18  
-    assert_migration "db/migrate/create_product_lines.rb", /add_index :product_lines, :product_id/
19  
-    assert_migration "db/migrate/create_product_lines.rb", /references :user/
20  
-    assert_migration "db/migrate/create_product_lines.rb", /add_index :product_lines, :user_id/
  17
+    assert_migration "db/migrate/create_product_lines.rb", /belongs_to :product, index: true/
  18
+    assert_migration "db/migrate/create_product_lines.rb", /references :user, index: true/
21 19
 
22 20
     # Route
23 21
     assert_file "config/routes.rb" do |route|

0 notes on commit 039a118

Please sign in to comment.
Something went wrong with that request. Please try again.