1

I'm using Rails 5 with minitest and trying to run a single test file. The file is "test/controllers/issues_controller_test.rb" so I thought I could run

rake test TEST=test/controllers/issues_controller_test.rb

but I get an error when I try and do this ...

localhost:myproject davea$ rake test TEST=test/controllers/issues_controller_test.rb
Run options: --seed 24216

# Running:

E

Error:
IssuesControllerTest#test_logged_in_should_get_issues_page:
NoMethodError: undefined method `users' for #<IssuesControllerTest:0x007fac86c864c0>
    test/controllers/issues_controller_test.rb:7:in `block in <class:IssuesControllerTest>'


bin/rails test test/controllers/issues_controller_test.rb:6



Finished in 0.006048s, 165.3439 runs/s, 0.0000 assertions/s.

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips

Note that when I run "rails test" I do not get any errors at all on this file, so my question is, how do I run a single test file using minitest ?

Dave
  • 15,639
  • 133
  • 442
  • 830

1 Answers1

4

bin/rails test test/controllers/issues_controller_test.rb

dstull
  • 338
  • 1
  • 9
  • See https://stackoverflow.com/questions/5285711/is-it-possible-to-run-a-single-test-in-minitest for more alternatives – bjelli Feb 04 '19 at 08:26
  • Feeling kind of stupid: when I try the suggestion here, I basically get bin/rails has no clue what the heck test means. – jaydel Jun 13 '19 at 15:19