saucy-kiss 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md
CHANGED
@@ -2,10 +2,10 @@ module Saucy
|
|
2
2
|
module Kiss
|
3
3
|
module ControllerFilters
|
4
4
|
def identify_to_kissmetrics
|
5
|
-
if
|
6
|
-
km.identify("account-#{current_account.id}")
|
7
|
-
else
|
5
|
+
if signed_out?
|
8
6
|
km.identify(nil)
|
7
|
+
elsif current_account?
|
8
|
+
km.identify("account-#{current_account.id}")
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -42,16 +42,24 @@ describe Saucy::Kiss::ControllerFilters do
|
|
42
42
|
controller_class.hidden_actions.should == [:identify_to_kissmetrics]
|
43
43
|
end
|
44
44
|
|
45
|
-
it "sets identity based on the account if
|
46
|
-
controller.stub(:
|
45
|
+
it "sets identity based on the account if you're signed in and have a current_account" do
|
46
|
+
controller.stub(:signed_out? => false,
|
47
|
+
:current_account? => true,
|
47
48
|
:current_account => account)
|
48
49
|
km.should_receive(:identify).with("account-12345")
|
49
50
|
controller.identify_to_kissmetrics
|
50
51
|
end
|
51
52
|
|
52
|
-
it "clears identity when
|
53
|
-
controller.stub(:
|
53
|
+
it "clears identity when you sign out" do
|
54
|
+
controller.stub(:signed_out? => true)
|
54
55
|
km.should_receive(:identify).with(nil)
|
55
56
|
controller.identify_to_kissmetrics
|
56
57
|
end
|
58
|
+
|
59
|
+
it "does not re-identify if you're signed in but have no account, e.g. on the /accounts page" do
|
60
|
+
controller.stub(:signed_out? => false,
|
61
|
+
:current_account? => false)
|
62
|
+
km.should_receive(:identify).never()
|
63
|
+
controller.identify_to_kissmetrics
|
64
|
+
end
|
57
65
|
end
|