spec/analytical/google_spec.rb in analytical-1.5.0 vs spec/analytical/google_spec.rb in analytical-1.6.0

- old
+ new

@@ -4,33 +4,33 @@ before(:each) do @parent = mock('api', :options=>{:google=>{:key=>'abc'}}) end describe 'on initialize' do it 'should set the command_location' do - a = Analytical::Google::Api.new @parent, {:key=>'abc'} + a = Analytical::Google::Api.new :parent=>@parent, :key=>'abc' a.tracking_command_location.should == :head_append end it 'should set the options' do - a = Analytical::Google::Api.new @parent, {:key=>'abc'} - a.options.should == {:key=>'abc'} + a = Analytical::Google::Api.new :parent=>@parent, :key=>'abc' + a.options.should == {:key=>'abc', :parent=>@parent} end end describe '#track' do it 'should return the tracking javascript' do - @api = Analytical::Google::Api.new @parent, {:key=>'abcdef'} + @api = Analytical::Google::Api.new :parent=>@parent, :key=>'abcdef' @api.track.should == "_gaq.push(['_trackPageview']);" @api.track('pagename', {:some=>'data'}).should == "_gaq.push(['_trackPageview', \"pagename\"]);" end end describe '#identify' do it 'should return an empty string' do - @api = Analytical::Google::Api.new @parent, {:key=>'abcdef'} + @api = Analytical::Google::Api.new :parent=>@parent, :key=>'abcdef' @api.identify('nothing', {:matters=>'at all'}).should == '' end end describe '#init_javascript' do it 'should return the init javascript' do - @api = Analytical::Google::Api.new @parent, {:key=>'abcdef'} + @api = Analytical::Google::Api.new :parent=>@parent, :key=>'abcdef' @api.init_javascript(:head_prepend).should == '' @api.init_javascript(:head_append).should =~ /abcdef/ @api.init_javascript(:head_append).should =~ /google-analytics.com\/ga.js/ @api.init_javascript(:body_prepend).should == '' @api.init_javascript(:body_append).should == '' \ No newline at end of file