rack-piwik 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. data/test/test_rack_piwik.rb +14 -5
  2. metadata +1 -1
@@ -7,10 +7,10 @@ class TestRackPiwik < Test::Unit::TestCase
7
7
  setup { mock_app :async => true, :tracker => 'somebody', :piwik_url => 'piwik.example.org', :piwik_id => '123' }
8
8
  should "add tracker if body element is present" do
9
9
  get "/body_only"
10
- assert_match %r{https://piwik.example.org/}, last_response.body
11
- assert_match %r{123\);}, last_response.body
12
- assert_match %r{</noscript>\n<!-- End Piwik Code --></body>}, last_response.body
13
- assert_equal "650", last_response.headers['Content-Length']
10
+ assert_match 'http://piwik.example.org/', last_response.body
11
+ assert_match '_paq.push(["setSiteId", "123"]);', last_response.body
12
+ assert_match %r{</noscript>\n<!-- End Piwik --></body>}, last_response.body
13
+ assert_equal 787, last_response.headers['Content-Length'].to_i
14
14
  end
15
15
 
16
16
  should "omit 404 tracking for other responses with other status" do
@@ -44,7 +44,16 @@ class TestRackPiwik < Test::Unit::TestCase
44
44
 
45
45
  =begin
46
46
  context "Synchronous" do
47
- setup { mock_app :async => false, :tracker => 'whatthe', :piwik_url => 'piwik.example.org', :piwik_id => '123' }
47
+ setup { mock_app :async => false, :tracker => 'somebody', :piwik_url => 'piwik.example.org', :piwik_id => '123' }
48
+
49
+ should "add tracker if body element is present" do
50
+ get "/body_only"
51
+ assert_match %r{https://piwik.example.org/}, last_response.body
52
+ assert_match %r{123\);}, last_response.body
53
+ assert_match %r{</noscript>\n<!-- End Piwik --></body>}, last_response.body
54
+ assert_equal "650", last_response.headers['Content-Length']
55
+ end
56
+
48
57
  should "show non-asynchronous tracker" do
49
58
  get "/bob"
50
59
  assert_match %r{.getTracker}, last_response.body
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-piwik
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: