mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #5856 from arunagw/build_fix_master
fix scaffold_generator_test.rb
This commit is contained in:
commit
039a118857
2 changed files with 6 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
Loading…
Reference in a new issue