I have the following spec:
describe 'active' do
it 'does not include inactive or deleted records' do
inactive_record= create(:record, :inactive)
deleted_record= create(:record, :deleted)
expect(described_class.active).not_to include inactive_record
expect(described_class.active).not_to include deleted_record
end
end
This is OK when there are two tests, but when I have 10 different statuses I need to check, I'd need to write out ten different expect lines. I can do something like this:
[records_not_to_be_included].each { |record| expect(described_class.active).not_to include record }
But would like to be able to do something like:
expect(described_class.active).not_to include_any_of [records_not_to_be_included]
Is this possible with RSpec?