Skip to content

Commit 5caff46

Browse files
committed
Add spec covering non-bson-ruby conversion
1 parent 6e19f68 commit 5caff46

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

spec/mongoid/criteria/queryable/selector_spec.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,17 @@ def localized?
417417
end
418418
end
419419

420+
context "and raw_value cannot be converted by bson-ruby" do
421+
422+
before do
423+
selector.send(method, "key", Mongoid::RawValue(4..5))
424+
end
425+
426+
it "returns the raw_value without conversion" do
427+
expect(selector["key"]).to eq(4..5)
428+
end
429+
end
430+
420431
context "and raw_value is a complex type" do
421432
config_override :map_big_decimal_to_decimal128, true
422433

@@ -665,6 +676,17 @@ def localized?
665676
end
666677
end
667678

679+
context "and raw_value cannot be converted by bson-ruby" do
680+
681+
before do
682+
selector.send(method, "key", Mongoid::RawValue(4..5))
683+
end
684+
685+
it "returns the raw_value without conversion" do
686+
expect(selector["key"]).to eq(4..5)
687+
end
688+
end
689+
668690
context "and raw_value is a complex type" do
669691

670692
before do

0 commit comments

Comments
 (0)