Skip to content

Commit 19c82cc

Browse files
committed
Specs WIP
1 parent a5e1875 commit 19c82cc

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

spec/integration/criteria/raw_value_spec.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
expect(Band.where(decibels: Mongoid::RawValue('90')).to_a).to eq [band6]
7575
end
7676

77-
it 'matches objects because String cannot be evolved to Range' do
77+
it 'matches objects without raw value because String cannot be evolved to Range' do
7878
expect(Band.where(decibels: '90').to_a).to eq [band6]
7979
end
8080
end
@@ -150,7 +150,7 @@
150150
expect(Band.where(decibels: Mongoid::RawValue(90)).to_a).to eq [band7]
151151
end
152152

153-
it 'matches objects because Integer cannot be evolved to Range' do
153+
it 'matches objects without raw value because Integer cannot be evolved to Range' do
154154
expect(Band.where(decibels: 90).to_a).to eq [band7]
155155
end
156156
end
@@ -224,7 +224,7 @@
224224
expect(Band.where(decibels: Mongoid::RawValue(90.0)).to_a).to eq [band7]
225225
end
226226

227-
it 'matches objects because Float cannot be evolved to Range' do
227+
it 'matches objects without raw value because Float cannot be evolved to Range' do
228228
expect(Band.where(decibels: 90.0).to_a).to eq [band7]
229229
end
230230
end
@@ -289,21 +289,21 @@
289289

290290
context 'String field' do
291291
it 'matches objects with raw value' do
292-
expect(Band.where(name: Mongoid::RawValue(BigDecimal('3'))).to_a).to eq []
292+
expect(Band.where(name: Mongoid::RawValue(BigDecimal('1'))).to_a).to eq [band6, band7]
293293
end
294294

295-
it 'matches objects without raw value' do
296-
expect(Band.where(name: BigDecimal('3')).to_a).to eq []
295+
it 'does not match objects without raw value' do
296+
expect(Band.where(name: BigDecimal('1')).to_a).to eq []
297297
end
298298
end
299299

300300
context 'Range field' do
301-
it 'does not match objects with raw value' do
302-
expect(Band.where(decibels: Mongoid::RawValue(BigDecimal('90'))).to_a).to eq []
301+
it 'matches objects with raw value' do
302+
expect(Band.where(decibels: Mongoid::RawValue(BigDecimal('90'))).to_a).to eq [band7]
303303
end
304304

305-
it 'does not match objects without raw value' do
306-
expect(Band.where(decibels: BigDecimal('90')).to_a).to eq []
305+
it 'matches objects without raw value because BigDecimal cannot be evolved to Range' do
306+
expect(Band.where(decibels: BigDecimal('90')).to_a).to eq [band7]
307307
end
308308
end
309309

@@ -376,9 +376,9 @@
376376
expect { Band.where(decibels: Mongoid::RawValue(30..90)).to_a }.to raise_error BSON::Error::UnserializableClass
377377
end
378378

379-
it 'does not match objects without raw value' do
380-
expect(Band.where(decibels: 30..90).to_a).to eq []
381-
expect(Band.where(decibels: 20..100).to_a).to eq []
379+
it 'matches objects without raw value because Range is evolved into a gte/lte query range' do
380+
expect(Band.where(decibels: 30..90).to_a).to eq [band7]
381+
expect(Band.where(decibels: 20..100).to_a).to eq [band7]
382382
end
383383
end
384384

0 commit comments

Comments
 (0)