@@ -23,14 +23,14 @@ def setup
2323 } . to_json
2424
2525 @response_status = 201
26- @response_body = "stub "
26+ @response_body = "{} "
2727
2828 stub_request ( :post , "https://api.getdrip.com/v2/12345/events" ) .
2929 to_return ( status : @response_status , body : @response_body , headers : { } )
3030 end
3131
3232 should "send the right request" do
33- expected = Drip ::Response . new ( @response_status , @response_body )
33+ expected = Drip ::Response . new ( @response_status , JSON . parse ( @response_body ) )
3434 assert_equal expected , @client . track_event ( @email , @action , @properties )
3535 end
3636 end
@@ -50,14 +50,14 @@ def setup
5050 } . to_json
5151
5252 @response_status = 201
53- @response_body = "stub "
53+ @response_body = "{} "
5454
5555 stub_request ( :post , "https://api.getdrip.com/v2/12345/events" ) .
5656 to_return ( status : @response_status , body : @response_body , headers : { } )
5757 end
5858
5959 should "send the right request" do
60- expected = Drip ::Response . new ( @response_status , @response_body )
60+ expected = Drip ::Response . new ( @response_status , JSON . parse ( @response_body ) )
6161 assert_equal expected , @client . track_event ( @email , @action , @properties , @options )
6262 end
6363 end
@@ -78,29 +78,29 @@ def setup
7878
7979 @payload = { "batches" => [ { "events" => @events } ] } . to_json
8080 @response_status = 201
81- @response_body = "stub "
81+ @response_body = "{} "
8282
8383 stub_request ( :post , "https://api.getdrip.com/v2/12345/events/batches" ) .
8484 to_return ( status : @response_status , body : @response_body , headers : { } )
8585 end
8686
8787 should "send the right request" do
88- expected = Drip ::Response . new ( @response_status , @response_body )
88+ expected = Drip ::Response . new ( @response_status , JSON . parse ( @response_body ) )
8989 assert_equal expected , @client . track_events ( @events )
9090 end
9191 end
9292
9393 context "#event_actions" do
9494 setup do
9595 @response_status = 200
96- @response_body = "stub "
96+ @response_body = "{} "
9797
9898 stub_request ( :get , "https://api.getdrip.com/v2/12345/event_actions" ) .
9999 to_return ( status : @response_status , body : @response_body , headers : { } )
100100 end
101101
102102 should "send the right request" do
103- expected = Drip ::Response . new ( @response_status , @response_body )
103+ expected = Drip ::Response . new ( @response_status , JSON . parse ( @response_body ) )
104104 assert_equal expected , @client . event_actions
105105 end
106106 end
0 commit comments