it('should create properly a new user from github with location', function (done) { var $u = createUser(); $u.profile.emails = [ {value: $u.email} ]; $u.profile._json = {location: 'Warsaw'}; userRepo.createAccFromGithub($u.accessToken, $u.tokenSecret, $u.profile) .then(function(user) { expect(user).to.be.a('object'); expect(user.profile).to.be.a('object'); expect(user.profile.location).to.be('Warsaw'); done(); }); });
function() { 'use strict'; var expect = require('expect.js'), ForgeSdk = require('../../src'); describe('AppPackageVersion', function() { it('should create an instance of AppPackageVersion', function() { var instance = new ForgeSdk.AppPackageVersion(); expect(instance).to.be.a(ForgeSdk.AppPackageVersion); }); }); }()
it('.find({ foo })', async function() { const posts = await Post.find({ title: 'New Post' }); expect(posts.length).to.be(1); expect(posts[0]).to.be.a(Post); expect(posts[0].title).to.be('New Post'); });
it('.with(...names).select()', async function() { const post = await Post.include('attachment').select('attachment.url, posts.title').first; expect(post.title).to.be('Archbishop Lazarus'); expect(post.attachment).to.be.a(Attachment); });
it('should create properly a new user from twitter with picture', function (done) { var $u = createUser(); $u.profile._json.profile_image_url_https = 'PICTURE_URL'; userRepo.createAccFromTwitter($u.accessToken, $u.tokenSecret, $u.profile) .then(function(user) { expect(user).to.be.a('object'); expect(user.profile).to.be.a('object'); expect(user.profile.picture).to.be('PICTURE_URL'); done(); }); });
function() { 'use strict'; var expect = require('expect.js'), ForgeSdk = require('../../src'), CreateItemRelationshipsStorageData = require('../../src/model/CreateItemRelationshipsStorageData'); describe('CreateItemRelationshipsStorage', function() { it('should create an instance of CreateItemRelationshipsStorage', function() { var instance = new ForgeSdk.CreateItemRelationshipsStorage(); expect(instance).to.be.a(ForgeSdk.CreateItemRelationshipsStorage); }); }); }()
it('should handle properly situation when email returned from facebook is empty', function (done) { var $u = createUser(); $u.profile._json = { email: null }; userRepo.createAccFromFacebook($u.accessToken, $u.refreshToken, $u.profile) .then(function(user) { expect(user).to.be.a('object'); expect(user.facebookId).to.be($u.uniqueness.toString()); expect(user.password).to.be(null); expect(user.email).to.be(user.facebookId + '@facebook.com'); done(); }); });
it('.last', async function() { const post = await Post.last; expect(post).to.be.a(Post); expect(post.title).to.be('Archangel Tyrael'); });
function() { 'use strict'; var expect = require('expect.js'), ForgeSdk = require('../../src'), BaseAttributesExtensionObject = require('../../src/model/BaseAttributesExtensionObject'); describe('CreateStorageDataAttributes', function() { it('should create an instance of CreateStorageDataAttributes', function() { var instance = new ForgeSdk.CreateStorageDataAttributes(); expect(instance).to.be.a(ForgeSdk.CreateStorageDataAttributes); }); }); }()
it('.find({ foo: null })', async function() { const posts = await Post.find({ thumb: null }); expect(posts.length).to.be(3); expect(posts[0]).to.be.a(Post); expect(posts[0].thumb).to.eql(null); });
function() { 'use strict'; var expect = require('expect.js'), ForgeSdk = require('../../src'), StorageRelationshipsTargetData = require('../../src/model/StorageRelationshipsTargetData'); describe('CreateStorageDataRelationshipsTarget', function() { it('should create an instance of CreateStorageDataRelationshipsTarget', function() { var instance = new ForgeSdk.CreateStorageDataRelationshipsTarget(); expect(instance).to.be.a(ForgeSdk.CreateStorageDataRelationshipsTarget); }); }); }()
function() { 'use strict'; var expect = require('expect.js'), ForgeSdk = require('../../src'), AppPackage = require('../../src/model/AppPackage'); describe('DesignAutomationAppPackages', function() { it('should create an instance of DesignAutomationAppPackages', function() { var instance = new ForgeSdk.DesignAutomationAppPackages(); expect(instance).to.be.a(ForgeSdk.DesignAutomationAppPackages); }); }); }()
function() { 'use strict'; var expect = require('expect.js'), ForgeSdk = require('../../src'), FormatsFormats = require('../../src/model/FormatsFormats'); describe('Formats', function() { it('should create an instance of Formats', function() { var instance = new ForgeSdk.Formats(); expect(instance).to.be.a(ForgeSdk.Formats); }); }); }()
function() { 'use strict'; var expect = require('expect.js'), ForgeSdk = require('../../src'), JsonApiRelationshipsLinksInternal = require('../../src/model/JsonApiRelationshipsLinksInternal'); describe('HubRelationships', function() { it('should create an instance of HubRelationships', function() { var instance = new ForgeSdk.HubRelationships(); expect(instance).to.be.a(ForgeSdk.HubRelationships); }); }); }()
function() { 'use strict'; var expect = require('expect.js'), ForgeSdk = require('../../src'), JobIgesOutputPayloadAdvanced = require('../../src/model/JobIgesOutputPayloadAdvanced'); describe('JobIgesOutputPayload', function() { it('should create an instance of JobIgesOutputPayload', function() { var instance = new ForgeSdk.JobIgesOutputPayload(); expect(instance).to.be.a(ForgeSdk.JobIgesOutputPayload); }); }); }()