Sha256: d15467ff7c8921229faa473ce08629348fe690113ee12732e1c331e557bc88f4

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Analytical::Comscore::Api" do
  before(:each) do
    @parent = mock('api', :options=>{:comscore=>{:key=>123}})
  end
  describe 'on initialize' do
    it 'should set the command_location' do
      a = Analytical::Comscore::Api.new :parent=>@parent, :key=>123
      a.tracking_command_location.should == :head_append
    end
    it 'should set the options' do
      a = Analytical::Comscore::Api.new :parent=>@parent, :key=>1234
      a.options.should == {:key=>1234, :parent=>@parent}
    end
  end
  describe '#init_javascript' do
    it 'should return the init javascript' do
      @api = Analytical::Comscore::Api.new :parent=>@parent, :key=>1234
      @api.init_javascript(:head_prepend).should == ''
      @api.init_javascript(:head_append).should =~ /scorecardresearch.com\/beacon.js/
      @api.init_javascript(:head_append).should =~ /1234/
      @api.init_javascript(:body_prepend).should == ''
      @api.init_javascript(:body_append).should == ''
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
analytical-1.8.0 spec/analytical/comscore_spec.rb
analytical-1.7.0 spec/analytical/comscore_spec.rb