module RSpec::Rails::Matchers

def be_a_new(model_class)

Other tags:
    Api: - public
def be_a_new(model_class)
  BeANew.new(model_class)
end

def be_new_record

Other tags:
    Api: - public
def be_new_record
  BeANewRecord.new
end

def be_valid(*args)

Other tags:
    Api: - public
def be_valid(*args)
  BeValid.new(*args)
end

def have_enqueued_job(job = nil)

Other tags:
    Api: - public
def have_enqueued_job(job = nil)
  unless ::ActiveJob::QueueAdapters::TestAdapter === ::ActiveJob::Base.queue_adapter
    raise StandardError, "To use have_enqueued_job matcher set `ActiveJob::Base.queue_adapter = :test`"
  end
  ActiveJob::HaveEnqueuedJob.new(job)
end

def have_http_status(target)

Other tags:
    See: https://github.com/rack/rack/blob/master/lib/rack/utils.rb - `Rack::Utils::SYMBOL_TO_STATUS_CODE`
    See: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/testing/test_response.rb - `ActionDispatch::TestResponse`

Other tags:
    Example: Works with standard `response` objects and Capybara's `page` -
    Example: Accepts numeric and symbol statuses -

Other tags:
    Api: - public
def have_http_status(target)
  raise ArgumentError, "Invalid HTTP status: nil" unless target
  HaveHttpStatus.matcher_for_status(target)
end