Sha256: 870c267fa4b5180e50d30b809e01027edbb833d3218560c316a0185d5b63692c
Contents?: true
Size: 687 Bytes
Versions: 8
Compression:
Stored size: 687 Bytes
Contents
RSpec.describe ROM::Relation, '#exist?' do include_context 'users and tasks' subject(:relation) { users } with_adapters do it 'returns true if relation has at least one tuple' do expect(relation.exist?).to be(true) end it 'returns false if relation is empty' do expect(relation.where(name: 'Klaus').exist?).to be(false) end it 'accepts a condition' do expect(relation.exist?(name: 'Jane')).to be(true) expect(relation.exist?(name: 'Klaus')).to be(false) end it 'accepts a block' do expect(relation.exist? { name.is('Jane') }).to be true expect(relation.exist? { name.is('Klaus') }).to be false end end end
Version data entries
8 entries across 8 versions & 1 rubygems