mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-18 20:59:39 +02:00
Tweak exception logging, sync stale behavior
This commit is contained in:
parent
9f13b5bb83
commit
29a8ac9d8a
6 changed files with 46 additions and 26 deletions
|
@ -17,4 +17,12 @@ module SyncableInterfaceTest
|
|||
@syncable.class.any_instance.expects(:perform_sync).with(mock_sync).once
|
||||
@syncable.perform_sync(mock_sync)
|
||||
end
|
||||
|
||||
test "any prior syncs for the same syncable entity are marked stale when new sync is requested" do
|
||||
stale_sync = @syncable.sync_later
|
||||
new_sync = @syncable.sync_later
|
||||
|
||||
assert_equal "stale", stale_sync.reload.status
|
||||
assert_equal "pending", new_sync.reload.status
|
||||
end
|
||||
end
|
||||
|
|
|
@ -172,15 +172,15 @@ class SyncTest < ActiveSupport::TestCase
|
|||
stale_pending = Sync.create!(
|
||||
syncable: accounts(:depository),
|
||||
status: :pending,
|
||||
created_at: 3.hours.ago
|
||||
created_at: 25.hours.ago
|
||||
)
|
||||
|
||||
stale_syncing = Sync.create!(
|
||||
syncable: accounts(:depository),
|
||||
status: :syncing,
|
||||
created_at: 3.hours.ago,
|
||||
pending_at: 3.hours.ago,
|
||||
syncing_at: 2.hours.ago
|
||||
created_at: 25.hours.ago,
|
||||
pending_at: 24.hours.ago,
|
||||
syncing_at: 23.hours.ago
|
||||
)
|
||||
|
||||
Sync.clean
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue