Skip to content

Commit

Permalink
Fix a race condition in the homework tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kytrinyx committed May 12, 2016
1 parent f63fdb5 commit e8f88c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/exercism/homework_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'psych'
require_relative '../test_helper'
require_relative '../active_record_helper'
require_relative '../../lib/exercism'
Expand All @@ -15,7 +16,7 @@ def test_status

UserExercise.create(attributes.merge(slug: 'leap', skipped_at: now))
UserExercise.create(attributes.merge(slug: 'clock', fetched_at: now, iteration_count: 0))
UserExercise.create(attributes.merge(slug: 'submssion', fetched_at: now, iteration_count: 1, last_iteration_at: now))
UserExercise.create(attributes.merge(slug: 'submission', fetched_at: now-20, iteration_count: 1, last_iteration_at: now-10))
UserExercise.create(attributes.merge(slug: 'gigasecond', last_iteration_at: now))

assert_equal homework.status('ruby').to_json, {
Expand All @@ -25,7 +26,7 @@ def test_status
submitted_at: now
},
skipped: ['leap'],
submitted: ['submssion'],
submitted: ['submission'],
fetched: ["sorry, tracking disabled for fetching"]
}.to_json
end
Expand Down

0 comments on commit e8f88c4

Please sign in to comment.