File tree Expand file tree Collapse file tree 7 files changed +25
-20
lines changed
lib/facebook_ads/ad_objects/server_side
spec/lib/facebook_ads/ad_objects/server_side Expand file tree Collapse file tree 7 files changed +25
-20
lines changed Original file line number Diff line number Diff line change 18
18
ruby-version : ${{ matrix.version }}
19
19
bundler-cache : true
20
20
21
+ - name : Run RSpec
22
+ continue-on-error : ${{ matrix.ruby == 'head' }}
23
+ run : bundle exec rspec
24
+
21
25
- name : Gem build
22
26
run : gem build *.gemspec
Original file line number Diff line number Diff line change
1
+ --require spec_helper
Original file line number Diff line number Diff line change @@ -411,10 +411,10 @@ def normalize
411
411
hash [ 'messaging_channel' ] = messaging_channel
412
412
end
413
413
unless original_event_data . nil?
414
- hash [ 'original_event_data' ] = original_event_data
414
+ hash [ 'original_event_data' ] = original_event_data . normalize
415
415
end
416
416
unless attribution_data . nil?
417
- hash [ 'attribution_data' ] = attribution_data
417
+ hash [ 'attribution_data' ] = attribution_data . normalize
418
418
end
419
419
hash
420
420
end
Original file line number Diff line number Diff line change 39
39
)
40
40
41
41
expect ( attribution_data . normalize ) . to eq ( {
42
- 'scope' : scope ,
43
- 'visit_time' : visit_time ,
44
- 'ad_id' : ad_id ,
45
- 'adset_id' : adset_id ,
46
- 'campaign_id' : campaign_id ,
47
- 'attr_window' : attr_window ,
48
- 'attribution_share' : attribution_share ,
49
- 'attribution_model' : attribution_model ,
42
+ 'scope' => scope ,
43
+ 'visit_time' => visit_time ,
44
+ 'ad_id' => ad_id ,
45
+ 'adset_id' => adset_id ,
46
+ 'campaign_id' => campaign_id ,
47
+ 'attr_window' => attr_window ,
48
+ 'attribution_share' => attribution_share ,
49
+ 'attribution_model' => attribution_model ,
50
50
} )
51
51
end
52
52
Original file line number Diff line number Diff line change 42
42
messages : 'message3' ,
43
43
fbtrace_id : 'fbtrace123' ,
44
44
}
45
- expected_response = FacebookAds ::ServerSide ::EventResponse . new ( response )
45
+ expected_response = FacebookAds ::ServerSide ::EventResponse . new ( ** response )
46
46
expect ( mock_ads_pixel ) . to receive_message_chain ( 'events.create' ) . with ( expected_params ) . and_return ( response )
47
- expect ( FacebookAds ::AdsPixel ) . to receive ( :get ) . with ( event_request_async . pixel_id ) . and_return ( mock_ads_pixel )
47
+ expect ( FacebookAds ::AdsPixel ) . to receive ( :get ) . with ( event_request_async . pixel_id , nil ) . and_return ( mock_ads_pixel )
48
48
promise = event_request_async . execute
49
49
response = promise . value!
50
50
Original file line number Diff line number Diff line change 136
136
messages : 'message3' ,
137
137
fbtrace_id : 'fbtrace123' ,
138
138
}
139
- expected_response = FacebookAds ::ServerSide ::EventResponse . new ( response )
139
+ expected_response = FacebookAds ::ServerSide ::EventResponse . new ( ** response )
140
140
expect ( mock_ads_pixel ) . to receive_message_chain ( 'events.create' ) . with ( expected_params ) . and_return ( response )
141
- expect ( FacebookAds ::AdsPixel ) . to receive ( :get ) . with ( event_request . pixel_id ) . and_return ( mock_ads_pixel )
141
+ expect ( FacebookAds ::AdsPixel ) . to receive ( :get ) . with ( event_request . pixel_id , nil ) . and_return ( mock_ads_pixel )
142
142
response = event_request . execute
143
143
144
144
expect ( response ) . to eq ( expected_response )
159
159
messages : 'message3' ,
160
160
fbtrace_id : 'fbtrace123' ,
161
161
}
162
- expected_response = FacebookAds ::ServerSide ::EventResponse . new ( response )
162
+ expected_response = FacebookAds ::ServerSide ::EventResponse . new ( ** response )
163
163
expect ( mock_ads_pixel ) . to receive_message_chain ( 'events.create' ) . with ( expected_params ) . and_return ( response )
164
- expect ( FacebookAds ::AdsPixel ) . to receive ( :get ) . with ( event_request . pixel_id ) . and_return ( mock_ads_pixel )
164
+ expect ( FacebookAds ::AdsPixel ) . to receive ( :get ) . with ( event_request . pixel_id , nil ) . and_return ( mock_ads_pixel )
165
165
response = event_request . execute
166
166
167
167
expect ( response ) . to eq ( expected_response )
Original file line number Diff line number Diff line change 41
41
allow ( FacebookAds ::ServerSide ::Util ) . to receive ( :normalize ) do |input , field_type |
42
42
"#{ field_type } _#{ input } -normalized"
43
43
end
44
- user_data = FacebookAds ::ServerSide ::UserData . new ( attrs )
44
+ user_data = FacebookAds ::ServerSide ::UserData . new ( ** attrs )
45
45
normalized = user_data . normalize
46
46
47
47
expect ( normalized ) . to eq (
83
83
allow ( FacebookAds ::ServerSide ::Util ) . to receive ( :normalize_array ) do |input , field_type |
84
84
input + [ field_type ]
85
85
end
86
- user_data = FacebookAds ::ServerSide ::UserData . new ( attrs )
86
+ user_data = FacebookAds ::ServerSide ::UserData . new ( ** attrs )
87
87
normalized = user_data . normalize
88
88
89
89
expect ( normalized ) . to eq (
216
216
expect ( user_data1 ) . to eq ( user_data2 )
217
217
expect ( user_data1 . hash ) . to eq ( user_data2 . hash )
218
218
219
- user_data1 = FacebookAds ::ServerSide ::UserData . new ( attrs )
220
- user_data2 = FacebookAds ::ServerSide ::UserData . new ( attrs )
219
+ user_data1 = FacebookAds ::ServerSide ::UserData . new ( ** attrs )
220
+ user_data2 = FacebookAds ::ServerSide ::UserData . new ( ** attrs )
221
221
expect ( user_data1 ) . to eq ( user_data2 )
222
222
expect ( user_data1 . hash ) . to eq ( user_data2 . hash )
223
223
end
You can’t perform that action at this time.
0 commit comments