Defect #26504

Rails 5 unit and functional tests

Added by Toshi MARUYAMA 5 months ago. Updated 20 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:4.0.0
Resolution: Affected version:

Description

On trunk r16872, "rake test:units" and "rake test:functionals" cannot run.
Rails 5 changes directories.

  • test/unit -> test/models
  • test/functional -> test/controllers

http://guides.rubyonrails.org/testing.html#rails-sets-up-for-testing-from-the-word-go

Associated revisions

Revision 16873
Added by Toshi MARUYAMA 5 months ago

add empty directories to run "rake test:units" and "rake test:functionals" (#26504)

Revision 16930
Added by Jean-Philippe Lang 5 months ago

Move helper tests to test/helpers (#26504).

Revision 16931
Added by Jean-Philippe Lang 5 months ago

Removes test/unit/helpers (#26504).

History

#1 Updated by Toshi MARUYAMA 5 months ago

I have committed r16873.

#2 Updated by Jean-Philippe Lang 5 months ago

Should we move the tests to the new models, controllers... folders?

#3 Updated by Toshi MARUYAMA 5 months ago

Jean-Philippe Lang wrote:

Should we move the tests to the new models, controllers... folders?

I don't know.
But Japanese document says

  • rake test:units -> run in test/models test/helpers, and test/unit
  • rake test:functionals -> run in test/controllers, test/mailers, and test/functional

#4 Updated by Toshi MARUYAMA 5 months ago

Toshi MARUYAMA wrote:

But Japanese document

I cannot find this part in English document .

#5 Updated by Jeremy Bailey 20 days ago

Should we move the tests to the new models, controllers... folders?

I don't know either, but I wanted to help out by finding the cause of the documentation discrepancy.

I cannot find this part in English document .

It looks like the localized Japanese version of the Rails guide is out of date. This table appeared in the English 4.1 version but was removed from the English back on March 29th, 2015.

Maybe this overview of changes to testing in Rails 5 will be helpful too.

It appears that rake test should now be bin/rails test in Rails 5. I'm not a Rails developer, just wanted to do a little detective work to move this forward as a user looking forward to using Redmine 4 eventually!

Also available in: Atom PDF