Changeset 18893 for platform/tdiary/spec
- Timestamp:
- 09/05/08 16:43:45 (3 months ago)
- Files:
-
- 1 modified
-
platform/tdiary/spec/google_analytics_spec.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/spec/google_analytics_spec.rb
r6813 r18893 3 3 4 4 describe "google_analytics plugin" do 5 def setup_google_analytics_plugin(profile_id )5 def setup_google_analytics_plugin(profile_id, mode) 6 6 fake_plugin(:google_analytics) { |plugin| 7 plugin.mode = mode 7 8 plugin.conf['google_analytics.profile'] = profile_id 8 9 } … … 11 12 describe "should render javascript" do 12 13 before do 13 @plugin = setup_google_analytics_plugin('53836-1' )14 @plugin = setup_google_analytics_plugin('53836-1', 'latest') 14 15 end 15 16 … … 20 21 end 21 22 23 describe "should render javascript" do 24 before do 25 @plugin = setup_google_analytics_plugin('53836-1', 'conf') 26 end 27 28 it "for footer" do 29 snippet = @plugin.footer_proc 30 snippet.should be_empty 31 end 32 end 33 22 34 describe "should not render when profile_id is empty" do 23 35 before do 24 @plugin = setup_google_analytics_plugin(nil )36 @plugin = setup_google_analytics_plugin(nil, 'latest') 25 37 end 26 38 … … 33 45 def expected_html_footer_snippet 34 46 expected = <<-SCRIPT 35 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> 36 </script> 37 <script type="text/javascript"> 38 _uacct = "UA-53836-1"; 39 urchinTracker(); 40 </script> 47 <script type="text/javascript"><!-- 48 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.") ; 49 document.write(unescape('%3Cscript src="' + gaJsHost + 'google-analytics.com/ga.js" type="text/javascript"%3E%3C/script%3E')) ; 50 // --></script> 51 <script type="text/javascript"><!-- 52 var pageTracker = _gat._getTracker("UA-53836-1"); 53 pageTracker._initData(); 54 pageTracker._trackPageview(); 55 // --></script> 41 56 SCRIPT 42 57 expected.gsub( /^\t/, '' ).chomp
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)