{"id":20290600,"url":"https://github.com/gocardless/rspec-que","last_synced_at":"2025-04-11T11:00:25.119Z","repository":{"id":29987677,"uuid":"33534984","full_name":"gocardless/rspec-que","owner":"gocardless","description":"RSpec matchers for testing Que","archived":false,"fork":false,"pushed_at":"2020-07-20T11:22:18.000Z","size":38,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":94,"default_branch":"master","last_synced_at":"2025-04-06T10:03:25.119Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gocardless.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-07T09:47:01.000Z","updated_at":"2020-07-20T11:21:48.000Z","dependencies_parsed_at":"2022-09-07T18:31:23.793Z","dependency_job_id":null,"html_url":"https://github.com/gocardless/rspec-que","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Frspec-que","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Frspec-que/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Frspec-que/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Frspec-que/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gocardless","download_url":"https://codeload.github.com/gocardless/rspec-que/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248381716,"owners_count":21094525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T15:08:26.115Z","updated_at":"2025-04-11T11:00:25.088Z","avatar_url":"https://github.com/gocardless.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSpec Que matchers\n\nThis gem defines a matcher for checking that Que jobs have been enqueued,\nin the style of [rspec-activejob](https://github.com/gocardless/rspec-activejob).\n\n## Installation\n\nAdd the dependency to your application's Gemfile:\n\n    gem 'rspec-que', '~\u003e 1.1.0'\n\nAnd then install from your Gemfile:\n\n    $ bundle\n\n## Usage\n\nThe matcher expects a block of code, and will expect that code to enqueue a job\nin Que. The matcher can take a class for the job as its arguments. It can also\nexpect the job to be queued with arguments via `.with(arg1, arg2)` or at a\nspecific time via `.at(time)`.\n\nIf the matcher does not match, it will display informations about jobs queued\nat the last stage of the matcher which did match. (For instance, if you specify\na job class, arguments, and a time, the matcher will display information about\njobs of the right class and arguments but at the wrong time.)\n\n```ruby\n# spec/spec_helper.rb\nrequire 'rspec/que'\n\nRSpec.configure do |config|\n  config.include(RSpec::Que)\n\n  # clean out the queue after each spec\n  config.after(:each) do\n    RSpec::Que.purge_jobs\n  end\nend\n\n# spec/controllers/my_controller_spec.rb\nRSpec.describe MyController do\n  let(:user) { create(:user) }\n  let(:params) { { user_id: user.id } }\n  let(:later_time) { DateTime.parse(\"2038-01-01T01:02:03+00:00\").utc }\n  subject(:make_request) { described_class.make_request(params) }\n\n  specify { expect { make_request }.to queue_up(RequestMaker).with(user) }\n  specify { expect { make_request }.to queue_up(DelayedRequest).at(later_time) }\nend\n```\n\n## Development\n\nSetup:\n``` shell\nbundle install\n```\n\nRun tests:\n\n``` shell\nbundle exec rake\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocardless%2Frspec-que","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgocardless%2Frspec-que","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocardless%2Frspec-que/lists"}