Project

General

Profile

Actions

Defect #26504

closed

Rails 5 unit and functional tests

Added by Toshi MARUYAMA over 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
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


Files

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

Updated by Toshi MARUYAMA over 7 years ago

I have committed r16873.

Actions #2

Updated by Jean-Philippe Lang over 7 years ago

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

Actions #3

Updated by Toshi MARUYAMA over 7 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
Actions #4

Updated by Toshi MARUYAMA over 7 years ago

Toshi MARUYAMA wrote:

But Japanese document

I cannot find this part in English document .

Actions #5

Updated by Jeremy Bailey about 7 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!

Actions #6

Updated by Jean-Philippe Lang about 6 years ago

  • Target version deleted (4.0.0)

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

Actions #7

Updated by Toshi MARUYAMA over 4 years 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
Actions

Also available in: Atom PDF