mlzboy
mlzboy

Reputation: 14721

how not to create unit test file in rails3

rails g model GiftProduct -p --migration=false --fixture=false

i tried this code,and it reduce some generate file but still can't find how to avoid unit test file genertate,

in fact i only want a model file

i'm new on rail3,hope someone could help me below is the generate result

  invoke  active_record
  create    app/models/gift_product.rb
  invoke    test_unit
  create      test/unit/gift_product_test.rb

Upvotes: 1

Views: 2484

Answers (3)

imderek
imderek

Reputation: 1316

Works in Rails 3.2:

rails g model Foo --no-test-framework

Upvotes: 25

John
John

Reputation: 9456

You could try setting the test framework to nil or any non-existent test framework.

rails g model Test -t nil

Outputs

invoke  active_record
create    db/migrate/20101102025557_create_tests.rb
create    app/models/test.rb
 error    nil [not found]

Admittedly, not the nicest or most correct way of doing it, but it works.

Upvotes: -1

Sam 山
Sam 山

Reputation: 42863

try this

rails g model project  --no-tests --no-fixtures --no-migrations

I'm not only R3 yest so I'm not sure

Upvotes: 0

Related Questions