Permalink
Browse files

fixing specs

  • Loading branch information...
1 parent 43e770d commit 2189f67bcfd4a147d7777584f60c8b7d4f2c7f00 @joshuavial joshuavial committed Jul 14, 2011
Showing with 4 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +3 −3 spec/analytics_spec.rb
View
@@ -15,3 +15,4 @@ spec/reports
test/tmp
test/version_tmp
tmp
+*.swp
View
@@ -4,7 +4,7 @@
include Split::Helper
it "should generate valid analytics javascript" do
tracking_code = tracking_code(:account => 'UA-12345-6')
- tracking_code.should eql(" <script type=\"text/javascript\">\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'UA-12345-6']);\n \n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n </script>\n")
+ tracking_code.should eql(" <script type=\"text/javascript\">\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'UA-12345-6']);\n \n _gaq.push(['_trackPageview']);\n _gaq.push(['_trackPageLoadTime']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n </script>\n")
end
it "should add custom variables for every test the user is involved in" do
@@ -14,6 +14,6 @@
session[:split].should eql({'link_colour' => first_alt,'link_text' => second_alt})
tracking_code = tracking_code(:account => 'UA-12345-6')
- tracking_code.should eql(" <script type=\"text/javascript\">\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'UA-12345-6']);\n _gaq.push(['_setCustomVar', 1, 'link_colour', '#{first_alt}', 1]);\n_gaq.push(['_setCustomVar', 2, 'link_text', '#{second_alt}', 1]);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n </script>\n")
+ tracking_code.should eql(" <script type=\"text/javascript\">\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'UA-12345-6']);\n _gaq.push(['_setCustomVar', 1, 'link_colour', '#{first_alt}', 1]);\n_gaq.push(['_setCustomVar', 2, 'link_text', '#{second_alt}', 1]);\n _gaq.push(['_trackPageview']);\n _gaq.push(['_trackPageLoadTime']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n </script>\n")
end
-end
+end

0 comments on commit 2189f67

Please sign in to comment.