satellite 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -36,7 +36,7 @@ module Satellite
36
36
  end
37
37
 
38
38
  def track_page_view(path=nil)
39
- utm_params.merge({ :utmp => path }) if path
39
+ self.utm_params = self.utm_params.merge({ :utmp => path }) if path
40
40
  track
41
41
  end
42
42
 
data/satellite.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{satellite}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Maik Vlcek}]
@@ -2,6 +2,24 @@ require 'helper'
2
2
 
3
3
  class TestSatellite < Test::Unit::TestCase
4
4
 
5
+ VALID_GOOGLE_ANALYTICS_PARAMS = {
6
+ :utms => 1,
7
+ #:utmn => 123456789, autogenerated
8
+ :utmhn => 'api.mymobai.com',
9
+ :utme => '5(controller*action*coupon_redeem)(10)8(test)9(Please_track_this)11(1)',
10
+ :utmcn => 1,
11
+ :utmcs => 'UTF-8',
12
+ :utmsr => '1440x900',
13
+ :utmul => 'de',
14
+ :utmje => '1',
15
+ :utmfl => '10.3%20r183',
16
+ :utmdt => 'Properly track a page view',
17
+ #:utmhid => '1655425535', auto
18
+ :utmr => 'test.local/properly track a page view',
19
+ :utmp => '/test/properly-track-page-view',
20
+ #:utmac => nil, #set via 'Satellite::Adapters::GoogleAnalytics.account_id' in local_conf.rb
21
+ }
22
+
5
23
  should "create a proper google adapter" do
6
24
  tracker = Satellite.get_tracker(:google_analytics)
7
25
  assert_equal tracker.type, Satellite::Adapters::GoogleAnalytics
@@ -34,27 +52,21 @@ class TestSatellite < Test::Unit::TestCase
34
52
  #utmcc
35
53
  #utmu
36
54
  should "properly track a page view" do
37
- tracker = Satellite.get_tracker(:google_analytics, {
38
- :utms => 1,
39
- #:utmn => 123456789, autogenerated
40
- :utmhn => 'api.mymobai.com',
41
- :utme => '5(controller*action*coupon_redeem)(10)8(test)9(Please_track_this)11(1)',
42
- :utmcn => 1,
43
- :utmcs => 'UTF-8',
44
- :utmsr => '1440x900',
45
- :utmul => 'de',
46
- :utmje => '1',
47
- :utmfl => '10.3%20r183',
48
- :utmdt => 'Properly track a page view',
49
- #:utmhid => '1655425535', auto
50
- :utmr => 'test.local/properly track a page view',
51
- :utmp => '/test/properly-track-page-view',
52
- #:utmac => nil, #set via 'Satellite::Adapters::GoogleAnalytics.account_id' in local_conf.rb
53
- })
55
+ tracker = Satellite.get_tracker(:google_analytics, VALID_GOOGLE_ANALYTICS_PARAMS)
54
56
 
55
57
  assert_equal tracker.track_page_view, true
56
58
  end
57
59
 
60
+ should "properly track a page view with given path" do
61
+ tracker = Satellite.get_tracker(:google_analytics, VALID_GOOGLE_ANALYTICS_PARAMS)
62
+
63
+ path = "/test/path_test"
64
+ tracker.track_page_view(path)
65
+ tracker_path = tracker[:utmp].dup
66
+
67
+ assert_equal tracker_path, path
68
+ end
69
+
58
70
  context 'utme' do
59
71
 
60
72
  should "properly parse given utme string" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satellite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Maik Vlcek