How to generate a test file for an existing rails model

If you for­got to cre­ate a test file for your model, use this sim­ple com­mand to gen­er­ate the empty scaf­fold­ing file for your Model’s unit test.

rails g test_unit:model <modelname>

Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...