提交 039a1188 编写于 作者: P Piotr Sarnacki

Merge pull request #5856 from arunagw/build_fix_master

fix scaffold_generator_test.rb
......@@ -283,7 +283,7 @@ def test_index_is_added_for_belongs_to_association
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 @@ def test_index_is_added_for_references_association
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 @@ def test_index_is_skipped_for_belongs_to_association
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 @@ def test_index_is_skipped_for_references_association
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 @@ def test_scaffold_on_invoke
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|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册