{"action":"closed","issue":{"url":"https://api.github.com/repos/mperham/sidekiq/issues/2428","labels_url":"https://api.github.com/repos/mperham/sidekiq/issues/2428/labels{/name}","comments_url":"https://api.github.com/repos/mperham/sidekiq/issues/2428/comments","events_url":"https://api.github.com/repos/mperham/sidekiq/issues/2428/events","html_url":"https://github.com/mperham/sidekiq/issues/2428","id":94313090,"number":2428,"title":"Testing code that uses Sidekiq::API","user":{"login":"andrelandry","id":2453132,"avatar_url":"https://avatars.githubusercontent.com/u/2453132?v=3","gravatar_id":"","url":"https://api.github.com/users/andrelandry","html_url":"https://github.com/andrelandry","followers_url":"https://api.github.com/users/andrelandry/followers","following_url":"https://api.github.com/users/andrelandry/following{/other_user}","gists_url":"https://api.github.com/users/andrelandry/gists{/gist_id}","starred_url":"https://api.github.com/users/andrelandry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrelandry/subscriptions","organizations_url":"https://api.github.com/users/andrelandry/orgs","repos_url":"https://api.github.com/users/andrelandry/repos","events_url":"https://api.github.com/users/andrelandry/events{/privacy}","received_events_url":"https://api.github.com/users/andrelandry/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mperham/sidekiq/labels/feature","name":"feature","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-10T14:08:05Z","updated_at":"2015-07-10T16:01:18Z","closed_at":"2015-07-10T16:01:18Z","body":"I recently encountered a issue when trying to test code that uses sidekiq/api.\r\n\r\nI have a use case that needs to delete a scheduled job. When running a assertion to ensure the job is removed the test fails since the `jobs` array that replaces the redis queue never gets modified from the api.\r\n\r\nHere's a example.\r\n\r\n```Ruby\r\nrequire 'sidekiq/testing'\r\nSidekiq::Testing.fake!\r\n\r\njobid = HardWorker.perform_in(3.hours, 3)\r\n\r\njob = Sidekiq::ScheduledSet.new.find_job(jobid)\r\n\r\njob.delete\r\n\r\nexpect(HardWorker.jobs).to be_empty\r\n\r\n```\r\n\r\nAm I missing something when it comes to testing code that relies on Sidekiq::API? \r\n\r\nIf not, are you interested in a pull request that adds Sidekiq::API to sidekiq/testing?"}}