Defect #26504

Rails 5 unit and functional tests

Added by Toshi MARUYAMA over 4 years ago. Updated over 1 year ago.

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

0%

Category:-
Target version:-
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

issue-26504.diff Magnifier (1.16 KB) Toshi MARUYAMA, 2020-04-08 04:45

Associated revisions

Revision 16873
Added by Toshi MARUYAMA over 4 years ago

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

Revision 16930
Added by Jean-Philippe Lang about 4 years ago

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

Revision 16931
Added by Jean-Philippe Lang about 4 years ago

Removes test/unit/helpers (#26504).

History

#1 Updated by Toshi MARUYAMA over 4 years ago

I have committed r16873.

#2 Updated by Jean-Philippe Lang over 4 years ago

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

#3 Updated by Toshi MARUYAMA over 4 years 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 over 4 years ago

Toshi MARUYAMA wrote:

But Japanese document

I cannot find this part in English document .

#5 Updated by Jeremy Bailey almost 4 years 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!

#6 Updated by Jean-Philippe Lang about 3 years ago

  • Target version deleted (4.0.0)

Changes not required and would make merging test changes between branches less easy.

#7 Updated by Toshi MARUYAMA over 1 year ago

I have confirmed on r19683.

  • "rake test:units" catches failures in test/unit and test/helpers
  • "rake test:functionals" catches failures in test/functional

Also available in: Atom PDF