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
@@ -1,3 +1,7 @@
1
+ 0.1.3
2
+
3
+ Do not clear identity if user is signed in but without an account (e.g. /accounts)
4
+
1
5
  0.1.2
2
6
 
3
7
  Tell Snogmetrics to use the :array output strategy in test env,
@@ -2,10 +2,10 @@ module Saucy
2
2
  module Kiss
3
3
  module ControllerFilters
4
4
  def identify_to_kissmetrics
5
- if current_account?
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 there is a current_account when there is a current_account" do
46
- controller.stub(:current_account? => true,
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 there is not a current_account" do
53
- controller.stub(:current_account? => false)
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
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: saucy-kiss
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jason Morrison