Skip to content

Instantly share code, notes, and snippets.

@benoittgt
Created October 22, 2015 14:34
Show Gist options
  • Save benoittgt/22a0f4528a004f18eed4 to your computer and use it in GitHub Desktop.
Save benoittgt/22a0f4528a004f18eed4 to your computer and use it in GitHub Desktop.
# I have this code:
def destroy
old_store = mobile_application.store
users_ids = [1,2]
super
UpdateLastUpdatesWorker.perform_async old_store.id, users_ids
mobile_application.last_update = mobile_application.old_last_update
mobile_application.save!
end
# tests pass
def destroy
old_store = mobile_application.store
super
UpdateLastUpdatesWorker.perform_async old_store.id
mobile_application.last_update = mobile_application.old_last_update
mobile_application.save!
end
# tests fails with "Failed to destroy the record"
# If we edit the worker line with :
UpdateLastUpdatesWorker.perform_async old_store.id # fail !
UpdateLastUpdatesWorker.perform_async old_store.id, [] # Tests pass !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment