1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Fix attribute locking namespace conflict, duplicate syncs
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

This commit is contained in:
Zach Gollwitzer 2025-05-19 16:39:31 -04:00
parent ab5bce3462
commit 137219c121
11 changed files with 87 additions and 28 deletions

View file

@ -18,11 +18,19 @@ module SyncableInterfaceTest
@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
test "second sync request widens existing pending window" do
later_start = 2.days.ago.to_date
first_sync = @syncable.sync_later(window_start_date: later_start, window_end_date: later_start)
assert_equal "stale", stale_sync.reload.status
assert_equal "pending", new_sync.reload.status
earlier_start = 5.days.ago.to_date
wider_end = Date.current
assert_no_difference "@syncable.syncs.count" do
@syncable.sync_later(window_start_date: earlier_start, window_end_date: wider_end)
end
first_sync.reload
assert_equal earlier_start, first_sync.window_start_date
assert_equal wider_end, first_sync.window_end_date
end
end