spec/handler/google_analytics_spec.rb in rack-tracker-0.4.1 vs spec/handler/google_analytics_spec.rb in rack-tracker-0.4.2

- old
+ new

@@ -192,19 +192,19 @@ describe "with custom domain" do subject { described_class.new(env, tracker: 'somebody', cookie_domain: "railslabs.com").render } it "will show asyncronous tracker with cookieDomain" do expect(subject).to match(%r{ga\('create', 'somebody', {\"cookieDomain\":\"railslabs.com\"}\)}) - expect(subject).to match(%r{ga\('send', 'pageview'\)}) + expect(subject).to match(%r{ga\('send', 'pageview', {'location': window.location.href}\)}) end end describe "with user_id tracking" do subject { described_class.new(env, tracker: 'somebody', user_id: lambda { |env| return env[:user_id] } ).render } it "will show asyncronous tracker with userId" do expect(subject).to match(%r{ga\('create', 'somebody', {\"userId\":\"123\"}\)}) - expect(subject).to match(%r{ga\('send', 'pageview'\)}) + expect(subject).to match(%r{ga\('send', 'pageview', {'location': window.location.href}\)}) end end describe "with enhanced_link_attribution" do subject { described_class.new(env, tracker: 'happy', enhanced_link_attribution: true).render }