Task #2424

Feature #2422: exam automated tests

write unit tests

Added by Ward Vandewege almost 6 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assigned To:
Phil Hodgson
Category:
-
Start date:
04/01/2014
Due date:
% Done:

0%

Estimated time:

History

#1 Updated by Phil Hodgson almost 6 years ago

  • Status changed from New to In Progress
  • Start date set to 04/01/2014

#2 Updated by Phil Hodgson almost 6 years ago

  • Status changed from In Progress to New

#3 Updated by Phil Hodgson almost 6 years ago

I've seen in test/unit/exam_test.rb a failure on the version of the exam shown to the user. The test says that it should be the version of the exam that was created last before the user was created. And the Exam#version_for method takes a user record parameter, but then it promptly fails to reference the user record. The #version_for method in fact only returns the most recent exam version that exists, plain and simple. Which is correct?

#4 Updated by Ward Vandewege almost 6 years ago

Phil Hodgson wrote:

I've seen in test/unit/exam_test.rb a failure on the version of the exam shown to the user. The test says that it should be the version of the exam that was created last before the user was created. And the Exam#version_for method takes a user record parameter, but then it promptly fails to reference the user record. The #version_for method in fact only returns the most recent exam version that exists, plain and simple. Which is correct?

Yeah. The test is wrong; the user should always get the most recent exam version. The policy changed at some point.

Thanks,
Ward.

#5 Updated by Phil Hodgson almost 6 years ago

  • Status changed from New to In Progress

I would recommend then that the #version_for method be removed and all its uses refactored to use a new #last_published_version method. It's too confusing otherwise and not worth the logic that "maybe someday we'll want to use the User parameter again" - if we ever do, we'll refactor again.

#6 Updated by Phil Hodgson over 5 years ago

  • Status changed from In Progress to New

Also available in: Atom PDF