Skip to content

Commit dec5dd2

Browse files
Copilotscarroll32
andcommitted
Add test for string type casting
Co-authored-by: scarroll32 <11340230+scarroll32@users.noreply.github.com>
1 parent 11e5856 commit dec5dd2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/ransack/nodes/value_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ module Nodes
2020
expect(result).to eq(Date.parse(raw_value))
2121
end
2222
end
23+
24+
# Test that string type also works (for robustness)
25+
it "should cast 'date' string type correctly" do
26+
result = subject.cast('date')
27+
28+
expect(result).to be_a_kind_of(Date)
29+
expect(result).to eq(Date.parse(raw_value))
30+
end
2331
end
2432

2533
context "with a timestamp value" do

0 commit comments

Comments
 (0)