@@ -48,13 +48,13 @@ def env
4848 describe "with a event value" do
4949 def env
5050 { 'tracker' => { 'google_analytics' => [
51- Rack ::Tracker ::GoogleAnalytics ::Send . new ( category : "Users" , action : "Login" , label : "Standard" , value : 5 )
51+ Rack ::Tracker ::GoogleAnalytics ::Send . new ( category : "Users" , action : "Login" , label : "Standard" , value : "5" )
5252 ] } }
5353 end
5454
5555 subject { described_class . new ( env , tracker : 'somebody' ) . render }
5656 it "will show events with values" do
57- expect ( subject ) . to match ( %r{ga\( \" send\" ,{\" hitType\" :\" event\" ,\" eventCategory\" :\" Users\" ,\" eventAction\" :\" Login\" ,\" eventLabel\" :\" Standard\" ,\" eventValue\" :5 }\) } , )
57+ expect ( subject ) . to match ( %r{ga\( \" send\" ,{\" hitType\" :\" event\" ,\" eventCategory\" :\" Users\" ,\" eventAction\" :\" Login\" ,\" eventLabel\" :\" Standard\" ,\" eventValue\" :\" 5 \" }\) } , )
5858 end
5959 end
6060 end
@@ -75,7 +75,7 @@ def env
7575 expect ( subject ) . to match ( %r{ga\( \" ecommerce:addItem\" ,#{ { id : '1234' , name : 'Fluffy Pink Bunnies' , sku : 'DD23444' , category : 'Party Toys' , price : '11.99' , quantity : '1' } . to_json } } )
7676 end
7777 it "will add transaction" do
78- expect ( subject ) . to match ( %r{ga\( \" ecommerce:addTransaction\" ,#{ { id : '1234' , affiliation : 'Acme Clothing' , revenue : 11.99 , shipping : '5' , tax : '1.29' , currency : 'EUR' } . to_json } } )
78+ expect ( subject ) . to match ( %r{ga\( \" ecommerce:addTransaction\" ,#{ { id : '1234' , affiliation : 'Acme Clothing' , revenue : ' 11.99' , shipping : '5' , tax : '1.29' , currency : 'EUR' } . to_json } } )
7979 end
8080 it "will submit cart" do
8181 expect ( subject ) . to match ( %r{ga\( 'ecommerce:send'\) ;} )
0 commit comments