var frauPublisher = require('../../publisher'),
	request = require('request'),
	eventStream = require('event-stream'),
	gUtil = require('gulp-util');

var publisher = frauPublisher({
	appID: 'frau-publisher-test',
	creds: {
		key: '***REMOVED***',
		secret: process.env.CREDS_SECRET
	},
	devTag: 'test'
});

var content = 'some data';
var filename = 'test' + Math.random().toString(16).slice(2) + '.txt';
var file = new gUtil.File({
	cwd: '/',
	base: '/',
	path: '/' + filename,
	contents: new Buffer(content),
	stat: {
		size: content.length
	}
});

describe('publisher', function() {
	it.skip('should publish new file', function(cb) {
		console.log('file: ' + filename);

		eventStream.readArray( [file] )
			.pipe( publisher )
			.on('end', function() {
				// gulp-s3 sends the end event before it's actually done, so we need to introduce an artificial wait.
				setTimeout(function() {
					request.get( publisher.location + filename, function(error, result, body) {
						if (error) {
							cb(error);
						} else if (result.statusCode != 200 ) {
							cb(result.statusCode);
						} else if ( body !== content ){
							cb(body);
						} else {
							cb();
						}
					});
				}, 500);
			});
	});
});

@@ -177,17 +177,18 @@
 sher
-(%7B%0A%09appID
+.app(%7B%0A%09id
 : 'f
@@ -290,22 +290,51 @@
 devTag: 
-'test'
+Math.random().toString(16).slice(2)
 %0A%7D);%0A%0Ava
@@ -382,51 +382,8 @@
 test
-' + Math.random().toString(16).slice(2) + '
 .txt
@@ -573,13 +573,8 @@
 %0A%09it
-.skip
 ('sh
@@ -616,45 +616,8 @@
 ) %7B%0A
-%09%09console.log('file: ' + filename);%0A%0A
 %09%09ev

Update the secure test