rails_amp 0.1.6 → 0.1.7
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.
- checksums.yaml +4 -4
- data/lib/rails_amp/version.rb +1 -1
- data/spec/view_helpers/action_view_spec.rb +6 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8a0baf278db9973b9bea593b26a6b0b8a0bb1da1
|
|
4
|
+
data.tar.gz: b499f5a7fcc7198f1487a44515e6dec1a600a92f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e20e49af5ac7f91c5359d83d61fc9343cbd0b374f6394dfc650586f41c6181782f255538565155ba1514c22c713da5bec5a26da80da31c61768bb3f52c7f3e53
|
|
7
|
+
data.tar.gz: f5ac7fc3fe930e2389dc562d0b5b59222e4872505d733ce96b8f5e6b21e8ddabce43a16524b93b212c2b0f8ffc59d22ef7c96efb86618212656374ab10ab4fdd
|
data/lib/rails_amp/version.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'rails_helper'
|
|
2
2
|
|
|
3
|
-
# Specs for view helpers:
|
|
3
|
+
# Specs for view helpers:
|
|
4
|
+
# rails_amp_html_header, rails_amp_google_analytics_head, rails_amp_google_analytics_page_tracking
|
|
4
5
|
# These helpers don't use controller or request object.
|
|
5
6
|
describe RailsAmp::ViewHelpers::ActionView do
|
|
6
7
|
context '#rails_amp_html_header' do
|
|
@@ -10,14 +11,15 @@ describe RailsAmp::ViewHelpers::ActionView do
|
|
|
10
11
|
end
|
|
11
12
|
end
|
|
12
13
|
|
|
13
|
-
context '#
|
|
14
|
+
context '#rails_amp_google_analytics disabled' do
|
|
14
15
|
it 'returns analytics off' do
|
|
15
16
|
expect(RailsAmp.analytics).to eq ''
|
|
17
|
+
expect(rails_amp_google_analytics_head).to eq ''
|
|
16
18
|
expect(rails_amp_google_analytics_page_tracking).to eq ''
|
|
17
19
|
end
|
|
18
20
|
end
|
|
19
21
|
|
|
20
|
-
context '#
|
|
22
|
+
context '#rails_amp_google_analytics enabled' do
|
|
21
23
|
before(:each) do
|
|
22
24
|
RailsAmp.analytics = 'UA-12345-6'
|
|
23
25
|
end
|
|
@@ -29,7 +31,7 @@ describe RailsAmp::ViewHelpers::ActionView do
|
|
|
29
31
|
|
|
30
32
|
it 'returns analytics on' do
|
|
31
33
|
expect(RailsAmp.analytics).to eq 'UA-12345-6'
|
|
32
|
-
expect(
|
|
34
|
+
expect(rails_amp_google_analytics_head).to include('script async custom-element="amp-analytics"')
|
|
33
35
|
expect(rails_amp_google_analytics_page_tracking).to include('"account": "UA-12345-6"')
|
|
34
36
|
end
|
|
35
37
|
end
|