Sha256: 0b82ff379d0d55962b11c08df3a71242a85c6780bca832ce4c869a4a1bc3d710

Contents?: true

Size: 327 Bytes

Versions: 16

Compression:

Stored size: 327 Bytes

Contents

# frozen_string_literal: true

RSpec::Matchers.define :have_been_destroyed do
  match do |actual|
    !actual.class.where(id: actual.id).exists?
  end

  description do
    'model should have been destroyed'
  end

  failure_message do |actual|
    "expected #{actual.class}(id: #{actual.id}) to have been destroyed"
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
delayed_job_groups_plugin-0.12.0 spec/support/destroyed_model.rb
delayed_job_heartbeat_plugin-0.6.0 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.11.0 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.10.1 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.10.0 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.9.0 spec/support/destroyed_model.rb
delayed_job_heartbeat_plugin-0.5.0 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.8.0 spec/support/destroyed_model.rb
delayed_job_heartbeat_plugin-0.4.0 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.7.0 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.6.2 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.6.0 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.5.0 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.4.3 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.4.2 spec/support/destroyed_model.rb
delayed_job_groups_plugin-0.4.1 spec/support/destroyed_model.rb