<commit_before>
var fs = require('fs')
var path = require('path')
var should = require('should')
var base64url = require('base64-url')
var Purest = require('../../lib/provider')
var providers = require('../../config/providers')
var image = path.resolve(__dirname, '../fixtures/cat.png')
var audio = path.resolve(__dirname, '../fixtures/beep.mp3')


describe('post', function () {
  function error (err, done) {
    return (err instanceof Error)
      ? done(err)
      : (console.log(err) || done(new Error('Network error!')))
  }

  require('../utils/credentials')
  var cred = {
    app:require('../../config/app'),
    user:require('../../config/user')
  }

  var p = {}
  before(function () {
    for (var name in providers) {
      var options = {
        provider:name,
        defaults:{headers:{'User-Agent':'Purest'}}
      }
      if (providers[name].__provider.oauth) {
        options.key = cred.app[name].key
        options.secret = cred.app[name].secret
      }
      p[name] = new Purest(options)
    }
  })

  describe('facebook', function () {
    describe('request', function () {
      it('post', function (done) {
        p.facebook.post('me/feed', {
          qs:{access_token:cred.user.facebook.token},
          form:{message:'Sent on '+new Date()}
        },
        function (err, res, body) {
          debugger
          if (err) return error(err, done)
          body.id.should.match(/\d+_\d+/)
          done()
        })
      })
    })
    describe('query', function () {
      
    })
  })

  describe('google', function () {
    describe('request', function () {
      it('post', function (done) {
        var message = 
          'From: <NAME> <<EMAIL>>\n'+
          'To: Mailinator 1 <<EMAIL>>,'+
              'Mailinator 2 <<EMAIL>>\n'+
          'Cc: Mailinator 3 <<EMAIL>>\n'+
          'Bcc: <NAME> <<EMAIL>>\n'+
          'Subject: Purest is awesome! (gmail)\n'+
          'Date: '+(new Date())+'\n\n'+
          '<h1>True idd!</h1>'

        p.google.post('users/me/messages/send', {<commit_msg>Update gmail send test<commit_after>
var fs = require('fs')
var path = require('path')
var should = require('should')
var base64url = require('base64-url')
var Purest = require('../../lib/provider')
var providers = require('../../config/providers')
var image = path.resolve(__dirname, '../fixtures/cat.png')
var audio = path.resolve(__dirname, '../fixtures/beep.mp3')


describe('post', function () {
  function error (err, done) {
    return (err instanceof Error)
      ? done(err)
      : (console.log(err) || done(new Error('Network error!')))
  }

  require('../utils/credentials')
  var cred = {
    app:require('../../config/app'),
    user:require('../../config/user')
  }

  var p = {}
  before(function () {
    for (var name in providers) {
      var options = {
        provider:name,
        defaults:{headers:{'User-Agent':'Purest'}}
      }
      if (providers[name].__provider.oauth) {
        options.key = cred.app[name].key
        options.secret = cred.app[name].secret
      }
      p[name] = new Purest(options)
    }
  })

  describe('facebook', function () {
    describe('request', function () {
      it('post', function (done) {
        p.facebook.post('me/feed', {
          qs:{access_token:cred.user.facebook.token},
          form:{message:'Sent on '+new Date()}
        },
        function (err, res, body) {
          debugger
          if (err) return error(err, done)
          body.id.should.match(/\d+_\d+/)
          done()
        })
      })
    })
    describe('query', function () {
      
    })
  })

  describe('google', function () {
    describe('request', function () {
      it('gmail', function (done) {
        // 'Message-ID: <<EMAIL>>\n'+
        // 'Date: '+(new Date())+'\n'+
        // 'MIME-Version: 1.0\n'+
        // 'Content-Transfer-Encoding: quoted-printable\n'+
        // 'Content-Disposition: attachment; filename*=utf-8''report%E2%80%93may.pdf\n'+
        // 'Return-Path: <<EMAIL>>\n'+
        var message = 
          'From: Purest <<EMAIL>>\n'+
          'To: Mailinator 1 <<EMAIL>>,'+
              'Mailinator 2 <<EMAIL>>\n'+
          'Cc: Mailinator 3 <<EMAIL>>\n'+
          'Bcc: Mailinator 4 <<EMAIL>>\n'+
          'Subject: Purest is awesome! (gmail)\n'+
          'Content-Type: text/html; charset=utf-8\n'+
          '\n'+
          '<h1>True idd!</h1>'

        p.google.post('users/me/messages/send', {
{'fraction_non_alphanumeric': 0.1939859823649107, 'fraction_numerical': 0.006782726656115758, 'mean_word_length': 2.2268417213712617, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1509075', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1405, 'n_words': 283}