Search code examples
ruby-on-railsruby-on-rails-4minitest

Generating a minitest :spec test for an existing controller for functional testing


I have a controller and I want to generate a minitest -spec test for that controller for functional testing.

I know testfiles get generated upon controller or model generation, but ... Is there a rails generator for just creating a test with -spec?


Solution

  • The minitest-rails gem adds --spec argument to do this.

    $ rails generate controller Thing --spec