Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run only controller tests in MiniTest?

What is the rake command for running only controller tests in minitest? rake test:controller doesn't do the trick.

like image 210
CheeseFry Avatar asked Dec 08 '22 23:12

CheeseFry


2 Answers

Try making it plural. This is the typical command:

rake test:controllers

http://guides.rubyonrails.org/testing.html#rake-tasks-for-running-your-tests

Section 6 covers the rake commands for testing.

like image 133
Harry Zumwalt Avatar answered Dec 19 '22 04:12

Harry Zumwalt


Has to be plural rake test:controllers as you're running all of them.

Please take a look at http://guides.rubyonrails.org/testing.html#rake-tasks-for-running-your-tests for more rake commands.

If you want to run a specific file, then use the TEST argument:

rake test TEST=test/controllers/application_controller_test.rb

like image 20
miligraf Avatar answered Dec 19 '22 04:12

miligraf