{"size": 636, "ext": "js", "max_stars_repo_path": "server/src/plugins/users/models/test/testModelAuthProvider.js", "max_stars_repo_name": "zollipaul/Backend-Node.js", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/src/plugins/users/models/test/testModelAuthProvider.js", "max_issues_repo_name": "zollipaul/Backend-Node.js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/src/plugins/users/models/test/testModelAuthProvider.js", "max_forks_repo_name": "zollipaul/Backend-Node.js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.44, "max_line_length": 70, "alphanum_fraction": 0.6336477987}
import assert from 'assert';
import testMngr from '~/test/testManager';

describe('AuthProviderModel', () => {
  let models = testMngr.app.data.sequelize.models;

  before(async () => {
      await testMngr.start();
  });
  after(async () => {
      await testMngr.stop();
  });

  it('should successfully create an entry', async () => {
    const providerData = {
      name: 'facebook',
      authId: '1234567890'
    };
    let authProvider = await models.AuthProvider.create(providerData);
    let user = await models.User.findByUsername('admin');
    assert(user.get().id);
    await authProvider.setUser(user.get().id);
  });
});
