mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-24 09:46:11 +01:00
Replace User#time with UserTime#time
This commit is contained in:
parent
8512e8db3b
commit
96777c2e3a
13 changed files with 44 additions and 27 deletions
|
|
@ -84,12 +84,12 @@ class ProjectTest < ActiveSupport::TestCase
|
|||
|
||||
def test_review_project
|
||||
assert_nil @timemachine.last_reviewed
|
||||
assert @timemachine.needs_review?(nil)
|
||||
assert @timemachine.needs_review?(users(:admin_user))
|
||||
end
|
||||
|
||||
def test_review_completedprojects
|
||||
@timemachine.complete!
|
||||
assert !@timemachine.needs_review?(nil)
|
||||
assert !@timemachine.needs_review?(users(:admin_user))
|
||||
end
|
||||
|
||||
def test_complete_project
|
||||
|
|
|
|||
|
|
@ -3,11 +3,18 @@ require_relative '../../lib/staleness'
|
|||
|
||||
|
||||
class StalenessTest < Test::Unit::TestCase
|
||||
FakeUser = Struct.new(:time)
|
||||
FakePrefs = Struct.new(:time_zone)
|
||||
FakeUser = Struct.new(:time) do
|
||||
def prefs
|
||||
@prefs ||= FakePrefs.new("UTC")
|
||||
end
|
||||
end
|
||||
|
||||
FakeTask = Struct.new(:due, :completed, :created_at) do
|
||||
def completed?
|
||||
self.completed
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def now
|
||||
|
|
@ -28,6 +35,11 @@ class StalenessTest < Test::Unit::TestCase
|
|||
|
||||
def setup
|
||||
@current_user = FakeUser.new(now)
|
||||
Timecop.freeze(Time.local(2013,02,28))
|
||||
end
|
||||
|
||||
def teardown
|
||||
Timecop.return
|
||||
end
|
||||
|
||||
def test_item_with_due_date_is_not_stale_ever
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue