1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

fix scaffold_generator_test.rb and model_generator_test.rb

Broken after this 6a054b0038
This commit is contained in:
Arun Agrawal 2012-04-16 09:44:50 +05:30
parent b8f7482695
commit ba3e27532b
2 changed files with 6 additions and 8 deletions

View file

@ -283,7 +283,7 @@ class ModelGeneratorTest < Rails::Generators::TestCase
assert_migration "db/migrate/create_accounts.rb" do |m|
assert_method :change, m do |up|
assert_match(/add_index/, up)
assert_match(/index: true/, up)
end
end
end
@ -293,7 +293,7 @@ class ModelGeneratorTest < Rails::Generators::TestCase
assert_migration "db/migrate/create_accounts.rb" do |m|
assert_method :change, m do |up|
assert_match(/add_index/, up)
assert_match(/index: true/, up)
end
end
end
@ -303,7 +303,7 @@ class ModelGeneratorTest < Rails::Generators::TestCase
assert_migration "db/migrate/create_accounts.rb" do |m|
assert_method :change, m do |up|
assert_no_match(/add_index/, up)
assert_no_match(/index: true/, up)
end
end
end
@ -313,7 +313,7 @@ class ModelGeneratorTest < Rails::Generators::TestCase
assert_migration "db/migrate/create_accounts.rb" do |m|
assert_method :change, m do |up|
assert_no_match(/add_index/, up)
assert_no_match(/index: true/, up)
end
end
end

View file

@ -14,10 +14,8 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_file "app/models/product_line.rb", /class ProductLine < ActiveRecord::Base/
assert_file "test/unit/product_line_test.rb", /class ProductLineTest < ActiveSupport::TestCase/
assert_file "test/fixtures/product_lines.yml"
assert_migration "db/migrate/create_product_lines.rb", /belongs_to :product/
assert_migration "db/migrate/create_product_lines.rb", /add_index :product_lines, :product_id/
assert_migration "db/migrate/create_product_lines.rb", /references :user/
assert_migration "db/migrate/create_product_lines.rb", /add_index :product_lines, :user_id/
assert_migration "db/migrate/create_product_lines.rb", /belongs_to :product, index: true/
assert_migration "db/migrate/create_product_lines.rb", /references :user, index: true/
# Route
assert_file "config/routes.rb" do |route|