 
 casper.then ->
 	originalPerson = @evaluate ->
+		km = new window.AnonKissmetricsClient 'abc123',
+			storage: 'cookie'
+			storageKey: 'somethingCustom'
+
+		km.person
+
+	newPerson = @evaluate ->
+		km = new window.AnonKissmetricsClient 'abc123',
+			storage: 'cookie'
+			storageKey: 'somethingCustom'
+
+		km.person
+
+	@test.assertEquals originalPerson, newPerson, 'Person is persistent in cookies with custom storage key'
+
+casper.then ->
+	originalPerson = @evaluate ->
 		km = new window.AnonKissmetricsClient 'abc123', {storage: 'localStorage'}
 		km.person
 

	@test.assertTruthy ID, 'ID is stored in localStorage'

casper.then ->
	data = @evaluate ->
		km = new window.AnonKissmetricsClient 'abc123', {storage: 'cookie'}
		{cookies: document.cookie, person: km.person}

	@test.assertTruthy data.cookies.match matchString, 'Cookie is saved'

casper.then ->
	data = @evaluate ->
		km = new window.AnonKissmetricsClient 'abc123',
			storage: 'cookie'
			storageKey: 'somethingCustom'
		{cookies: document.cookie, person: km.person}

	matchString = "somethingCustom=#{data.person}"
	@test.assertTruthy data.cookies.match matchString, 'Cookie is saved with custom storage key'

casper.then ->
	originalPerson = @evaluate ->
		km = new window.AnonKissmetricsClient 'abc123', {storage: 'cookie'}
		km.person
