|
125 | 125 | expect(conversion_event.http_verb).to eq(:post)
|
126 | 126 | end
|
127 | 127 |
|
| 128 | + it 'should create a valid V2 Event when create_conversion_event is called when an attribute value is nil' do |
| 129 | + @expected_conversion_params['userFeatures'] = [ |
| 130 | + ] |
| 131 | + |
| 132 | + attributes = {'browser_type' => nil} |
| 133 | + |
| 134 | + conversion_event = @event_builder.create_conversion_event('test_event', 'test_user', attributes, nil, {'111127' => '111128'}) |
| 135 | + expect(conversion_event.params).to eq(@expected_conversion_params) |
| 136 | + expect(conversion_event.url).to eq(@expected_conversion_url) |
| 137 | + expect(conversion_event.http_verb).to eq(:post) |
| 138 | + end |
| 139 | + |
128 | 140 | it 'should create a valid V2 Event when create_conversion_event is called with revenue event tag' do
|
129 | 141 | @expected_conversion_params['eventMetrics'] = [{
|
130 | 142 | 'name' => 'revenue',
|
|
147 | 159 | expect(conversion_event.http_verb).to eq(:post)
|
148 | 160 | end
|
149 | 161 |
|
| 162 | + it 'should create a valid V2 Event when create_conversion_event is called when an event tag value is nil' do |
| 163 | + @expected_conversion_params['eventFeatures'] = [ |
| 164 | + { |
| 165 | + 'name' => 'purchasePrice', |
| 166 | + 'type' => 'custom', |
| 167 | + 'value' => 64.32, |
| 168 | + 'shouldIndex' => false |
| 169 | + }, |
| 170 | + ] |
| 171 | + |
| 172 | + event_tags = {'category' => nil,'purchasePrice' => 64.32} |
| 173 | + |
| 174 | + conversion_event = @event_builder.create_conversion_event('test_event', 'test_user', nil, event_tags, {'111127' => '111128'}) |
| 175 | + expect(conversion_event.params).to eq(@expected_conversion_params) |
| 176 | + expect(conversion_event.url).to eq(@expected_conversion_url) |
| 177 | + expect(conversion_event.http_verb).to eq(:post) |
| 178 | + end |
| 179 | + |
150 | 180 | it 'should create a valid V2 Event when create_conversion_event is called with revenue event tag' do
|
151 | 181 | @expected_conversion_params['eventMetrics'] = []
|
152 | 182 | @expected_conversion_params['eventFeatures'] = [
|
|
0 commit comments