File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
contrib/ruby_event_store-sequel/spec Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,27 @@ module Sequel
111111 expect ( event_record [ :valid_at ] ) . to be_nil
112112 end
113113
114+ specify "no valid-at storage optimization when different from created-at" do
115+ repository . append_to_stream (
116+ [
117+ SRecord . new (
118+ timestamp : t1 = with_precision ( Time . at ( 0 ) ) ,
119+ valid_at : t2 = with_precision ( Time . at ( 1 ) )
120+ )
121+ ] ,
122+ Stream . new ( GLOBAL_STREAM ) ,
123+ ExpectedVersion . any
124+ )
125+ record = repository . read ( specification . result ) . first
126+ expect ( record . timestamp ) . to eq ( t1 )
127+ expect ( record . valid_at ) . to eq ( t2 )
128+
129+ event_record = helper . sequel [ :event_store_events ] . where ( event_id : record . event_id ) . first
130+ expect ( event_record [ :created_at ] ) . to eq ( t1 )
131+ expect ( event_record [ :valid_at ] ) . to eq ( t2 )
132+ end
133+
134+
114135 private
115136
116137 def with_precision ( time )
You can’t perform that action at this time.
0 commit comments