2013-06-30 13:15:56 +08:00
|
|
|
var helper = require(__dirname + '/../test-helper');
|
|
|
|
var pg = helper.pg;
|
|
|
|
|
|
|
|
var host = 'ec2-107-20-224-218.compute-1.amazonaws.com';
|
|
|
|
var database = 'db6kfntl5qhp2';
|
|
|
|
var user = 'kwdzdnqpdiilfs';
|
|
|
|
var port = 5432;
|
|
|
|
|
|
|
|
var config = {
|
|
|
|
host: host,
|
|
|
|
port: port,
|
|
|
|
database: database,
|
|
|
|
user: user,
|
2013-06-30 14:19:17 +08:00
|
|
|
password: 'uaZoSSHgi7mVM7kYaROtusClKu',
|
2013-06-30 13:15:56 +08:00
|
|
|
ssl: true
|
|
|
|
};
|
|
|
|
|
2014-04-25 13:45:34 +08:00
|
|
|
test('connection with config ssl = true', function() {
|
|
|
|
//connect & disconnect from heroku
|
|
|
|
pg.connect(config, assert.calls(function(err, client, done) {
|
|
|
|
assert.isNull(err);
|
|
|
|
client.query('SELECT NOW() as time', assert.success(function(res) {
|
|
|
|
assert(res.rows[0].time.getTime());
|
|
|
|
done();
|
|
|
|
pg.end();
|
|
|
|
}))
|
2014-05-02 12:32:15 +08:00
|
|
|
}));
|
2014-04-25 13:45:34 +08:00
|
|
|
});
|