diff --git a/vendor/plugins/blitz/features/model_generator.feature b/vendor/plugins/blitz/features/model_generator.feature index a8b3375..3f526e9 100644 --- a/vendor/plugins/blitz/features/model_generator.feature +++ b/vendor/plugins/blitz/features/model_generator.feature @@ -22,8 +22,8 @@ Feature: Rails model generator And the blitz plugin is installed When I generate a model "Post" that belongs to a "User" Then a factory for "Post" should have an association to "User" - And the "Post" unit test should have "should_belong_to :user" macro - And the "Post" unit test should have "should_have_db_index :user_id" macro + And the "Post" unit test should have "should_belong_to :user" macro + And the "Post" unit test should have "should_have_index :user_id" macro And the "posts" table should have db index on "user_id" And the "Post" model should have "belongs_to :user" macro diff --git a/vendor/plugins/blitz/generators/model/templates/unit_test.rb b/vendor/plugins/blitz/generators/model/templates/unit_test.rb index 9021608..2703e36 100644 --- a/vendor/plugins/blitz/generators/model/templates/unit_test.rb +++ b/vendor/plugins/blitz/generators/model/templates/unit_test.rb @@ -6,8 +6,8 @@ class <%= class_name %>Test < ActiveSupport::TestCase end <% attributes.each do |attribute| -%> <% if attribute.reference? -%> - should_belong_to :<%= attribute.name %> - should_have_db_index :<%= attribute.name %>_id + should_belong_to :<%= attribute.name %> + should_have_index :<%= attribute.name %>_id <% end -%> <% if attribute.type == :paperclip -%> should_have_attached_file :<%= attribute.name %> -- libgit2 0.21.2