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