Project

General

Profile

Actions

Task #2424

open

Feature #2422: exam automated tests

write unit tests

Added by Ward Vandewege about 10 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Normal
Assigned To:
Phil Hodgson
Actions #1

Updated by Phil Hodgson about 10 years ago

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

Updated by Phil Hodgson almost 10 years ago

  • Status changed from In Progress to New
Actions #3

Updated by Phil Hodgson almost 10 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?

Actions #4

Updated by Ward Vandewege almost 10 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.

Actions #5

Updated by Phil Hodgson almost 10 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.

Actions #6

Updated by Phil Hodgson almost 10 years ago

  • Status changed from In Progress to New
Actions

Also available in: Atom PDF