@@ -59,41 +59,14 @@ def env
5959 end
6060 end
6161
62- describe '#tracker_options' do
63- describe 'with site_type' do
64- context 'returning a value' do
65- subject { described_class . new ( env , { site_type : -> ( env ) { 'd' } } ) }
66-
67- it 'returns hash with userId' do
68- expect ( subject . tracker_options ) . to eql ( { site_type : 'd' } )
69- end
70- end
71-
72- context 'returning nil' do
73- subject { described_class . new ( env , { site_type : -> ( env ) { nil } } ) }
74-
75- it 'returns hash without userId' do
76- expect ( subject . tracker_options ) . to eql ( { } )
77- end
78- end
79- end
80-
81- describe 'with user_id option' do
82- context 'returning a value' do
83- subject { described_class . new ( env , { user_id : -> ( env ) { '123' } } ) }
84-
85- it 'returns hash with userId' do
86- expect ( subject . tracker_options ) . to eql ( { user_id : '123' } )
87- end
88- end
89-
90- context 'returning nil' do
91- subject { described_class . new ( env , { user_id : -> ( env ) { nil } } ) }
92-
93- it 'returns hash without userId' do
94- expect ( subject . tracker_options ) . to eql ( { } )
95- end
96- end
62+ describe '#tracker_events' do
63+ subject { described_class . new ( env , { set_account : '1234' , set_site_type : -> ( env ) { 'd' } , set_customer_id : -> ( env ) { nil } } ) }
64+
65+ specify do
66+ expect ( subject . tracker_events ) . to match_array [
67+ Rack ::Tracker ::Criteo ::Event . new ( event : 'setSiteType' , type : 'd' ) ,
68+ Rack ::Tracker ::Criteo ::Event . new ( event : 'setAccount' , account : '1234' )
69+ ]
9770 end
9871 end
9972
0 commit comments