segmentio/analytics.js-integrations — pull request #244 by lancejpollard (2014-06-26 00:09:27+00:00)
Title: google-analytics: port tests to new api

@ianstormtaylor ported the google analytics tests, but are 3 that aren't passing. i didn't change the tests other than the method names, so how do you think these should be fixed? seems like maybe the initial tests weren't getting the expected behavior maybe.

```
should send a page view ‣
Error: Expected "stub" to be called with "[
"send",
"pageview",
{}
]",
but it was called with "[
"send",
"pageview",
{
"page": "/",
"title": "integrations tests",
"location": "http://localhost:4202/?grep=Google%20Analytics"
}
]".
at module.exports.exports (http://localhost:4202/build/build.js:260:9)
at Analytics.analytics.called (http://localhost:4202/build/build.js:21307:5)
at Context. (http://localhost:4202/build/build.js:4747:21)
at Test.Runnable.run (http://localhost:4202/test/mocha.js:4212:32)
at Runner.runTest (http://localhost:4202/test/mocha.js:4584:10)
at http://localhost:4202/test/mocha.js:4630:12
at next (http://localhost:4202/test/mocha.js:4510:14)
at http://localhost:4202/test/mocha.js:4519:7
at next (http://localhost:4202/test/mocha.js:4463:23)
at http://localhost:4202/test/mocha.js:4482:7
```
```
should send a stored category ‣
Error: Expected "stub" to be called with "[
"send",
"event",
{
"eventCategory": "category",
"eventAction": "event",
"eventValue": 0
}
]",
but it was called with "[
"send",
"pageview",
{
"page": "/",
"title": "category",
"location": "http://localhost:4202/?grep=Google%20Analytics"
}
]".
at module.exports.exports (http://localhost:4202/build/build.js:260:9)
at Analytics.analytics.called (http://localhost:4202/build/build.js:21307:5)
at Context. (http://localhost:4202/build/build.js:4845:21)
at Test.Runnable.run (http://localhost:4202/test/mocha.js:4212:32)
at Runner.runTest (http://localhost:4202/test/mocha.js:4584:10)
at http://localhost:4202/test/mocha.js:4630:12
at next (http://localhost:4202/test/mocha.js:4510:14)
at http://localhost:4202/test/mocha.js:4519:7
at next (http://localhost:4202/test/mocha.js:4463:23)
at http://localhost:4202/test/mocha.js:4482:7
```
```
should send a page view ‣
Error: Expected "stub" to be called with "[
[
"_trackPageview",
null
]
]",
but it was called with "[
[
"_trackPageview",
"/"
]
]".
at module.exports.exports (http://localhost:4202/build/build.js:260:9)
at Analytics.analytics.called (http://localhost:4202/build/build.js:21307:5)
at Context. (http://localhost:4202/build/build.js:5133:21)
at Test.Runnable.run (http://localhost:4202/test/mocha.js:4212:32)
at Runner.runTest (http://localhost:4202/test/mocha.js:4584:10)
at http://localhost:4202/test/mocha.js:4630:12
```