       ,,2
 
       """
-    @export.exportDefault(template, file)
-    .then (result) ->
-      expect(result).toBe 'Export done.'
-      fs.readFileAsync file, {encoding: 'utf8'}
+    @export.exportDefault(template, outputLocation)
+    .then (result) ->
+      expect(result).toBe 'Export done.'
+      fs.readFileAsync outputLocation, {encoding: 'utf8'}
     .then (content) ->
       expect(content).toBe expectedCSV
       done()


    # export data in win1250 encoding
    @export.options.encoding = encoding
    @export.exportDefault(template, file)
    .then (result) ->
      expect(result).toBe 'Export done.'

      fs.readFileAsync file, {encoding: 'utf8'}
    .then (content) ->
      # compare exported data with text encoded in utf8
      expect(content).not.toBe expectedCSV

      # decode from win1250 to utf8 and compare with expected result
      decoded = iconv.decode(fs.readFileSync(file), encoding)
      expect(decoded).toBe expectedCSV

      done()

      '''
      productType,name,variantId
      '''
    outputLocation = '/tmp/output.csv'
    expectedCSV =
      """
      productType,name,variantId


      """
    @export.exportDefault(template, outputLocation, false)
    .then (result) ->
      expect(result).toBe 'Export done.'
      fs.readFileAsync outputLocation, {encoding: 'utf8'}
    .then (content) ->
      expect(content).toBe expectedCSV
      done()
