Permalink
Browse files

Add some DRYness to this snippet and fix the tests as needed afterwards.

  • Loading branch information...
1 parent 561f59b commit 332d19d985163383b2fdaf3b185ad913906c000d @illogic-al illogic-al committed Jun 2, 2013
View
2 app/views/piwik_analytics/piwik_tracking_tag.html.erb
@@ -1,6 +1,6 @@
<!-- Piwik -->
<script type="text/javascript">
- var pkBaseURL = (("https:" == document.location.protocol) ? "https://<%= url %>/" : "http://<%= url %>/");
+ var pkBaseURL = (("https:" == document.location.protocol) ? "https" : "http") + "://<%= url %>/";
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
View
2 spec/views/piwik_tracking_tag.html.erb_spec.rb
@@ -9,7 +9,7 @@
it "should render url" do
url = "example.com"
id_site = nil
- @template.result(binding).should =~ /http:\/\/example.com/
+ @template.result(binding).should =~ /:\/\/example.com/
end
it "should render id_site" do

0 comments on commit 332d19d

Please sign in to comment.