2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-03-28 05:33:41 +00:00
|
|
|
# taken from https://makandracards.com/makandra/1080-rspec-matcher-to-check-if-an-activerecord-exists-in-the-database
|
|
|
|
RSpec::Matchers.define :exist_in_database do
|
|
|
|
|
|
|
|
match do |actual|
|
|
|
|
actual.class.exists?(actual.id)
|
|
|
|
end
|
|
|
|
end
|