       expect(@stub).to.be.calledOnce
 
     it 'calls #_createTransport with proper args', ->
-      expect(@stub).to.be.calledWith(@pr, @url_with_payload)
+      expect(@stub).to.be.calledWith(@pr, @serialized_data)


  describe '#report', ->
    beforeEach ->
      @pr = new @promise()
      @subject = new @reporter()

    it 'returns a promise', ->
      res = @subject.report(@url, @payload)
      expect(res).to.be.an.instanceof @promise

    context 'when Settings.single_beacon is true', ->
      beforeEach ->
        @settings.single_beacon = true
        @spy = sinon.spy(@subject, '_handleJob')
        @actions = [@payload, @payload, @payload]

        @subject.report(@url, @actions)

      afterEach ->
        @settings.single_beacon = false
        @spy.restore()

      it 'sends a beacon for all actions', ->
        expect(@spy).to.be.calledOnce

      it 'sends the proper arguments', ->
        expect(@spy).to.be.calledWith(@url, @actions)

    context 'when Settings.single_beacon is false', ->
      beforeEach ->
        @settings.single_beacon = false
        @spy = sinon.spy(@subject, '_handleJob')
        @actions = [@payload, @payload, @payload2]

        @subject.report(@url, @actions)

      afterEach ->
        @settings.single_beacon = false
        @spy.restore()

      it 'sends a beacon for each action', ->
        expect(@spy.callCount).to.equal @actions.length

      it 'sends the proper arguments', ->
        expect(@spy.args[2]).to.contain @actions[2]

    context 'when transport uses image', ->
      beforeEach ->

    @scr_len_before = document.getElementsByTagName('script').length

    @url = 'foo.bar'
    @payload = {
      url: 'http://www.yogurt.foo/products/show/15400722'
      shop_code: 'SA-XXXX-Y'
      actions: [
        {
          category: 'site'
          type: 'sendPageView'
        },
        {
          category: 'yogurt'
          type: 'productClick'
          data: {
            product_id: '15400722'
            shop_product_id: '752'
            shop_id: '2032'
          }
        },
      ]
    }
    @serialized_data = 'foo.bar?url=http%3A%2F%2Fwww.yogurt.foo%2Fproducts%2Fshow%2F15400722&shop_code=SA-XXXX-Y&actions=%5B%7B%22category%22%3A%22site%22%2C%22type%22%3A%22sendPageView%22%7D%2C%7B%22category%22%3A%22yogurt%22%2C%22type%22%3A%22productClick%22%2C%22data%22%3A%7B%22product_id%22%3A%2215400722%22%2C%22shop_product_id%22%3A%22752%22%2C%22shop_id%22%3A%222032%22%7D%7D%5D'

  describe 'instance', ->
    beforeEach (done) ->
