How to use the ember-data-factory-guy.mockFindAll function in ember-data-factory-guy

To help you get started, we’ve selected a few ember-data-factory-guy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
        let done = assert.async();
        mockFindAll('profile', 2, 'with_company', 'with_bat_man');

        FactoryGuy.store.findAll('profile').then(function(profiles) {
          assert.ok(profiles.get('length') === 2);
          assert.ok(profiles.get('firstObject.company.name') === 'Silly corp');
          assert.ok(profiles.get('lastObject.superHero.name') === 'BatMan');
          done();
        });
      });
    });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      mockFindAll('user', 0);

      FactoryGuy.store.findAll('user').then(function(profiles) {
        assert.ok(profiles.get('length') === 0);
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
        let done = assert.async();

        mockFindAll('user', 2, 'with_hats');

        FactoryGuy.store.findAll('user').then(function(users) {
          assert.ok(users.get('length') === 2);
          assert.ok(A(users.get('lastObject.hats')).mapBy('type') + '' === ['BigHat', 'BigHat'] + '');
          assert.ok(A(users.get('lastObject.hats')).mapBy('id') + '' === [3, 4] + '');
          done();
        });
      });
    });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      mockFindAll('user', 0);

      FactoryGuy.store.findAll('user').then(function(profiles) {
        assert.ok(profiles.get('length') === 0);
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
        let done = assert.async();
        mockFindAll('profile', 'goofy_description', {description: 'foo'}, ['goofy_description', {aBooleanField: true}]);

        FactoryGuy.store.findAll('profile').then(function(profiles) {
          assert.ok(profiles.get('length') === 3);
          assert.ok(A(profiles).objectAt(0).get('description') === 'goofy');
          assert.ok(A(profiles).objectAt(0).get('aBooleanField') === false);
          assert.ok(A(profiles).objectAt(1).get('description') === 'foo');
          assert.ok(A(profiles).objectAt(1).get('aBooleanField') === false);
          assert.ok(A(profiles).objectAt(2).get('description') === 'goofy');
          assert.ok(A(profiles).objectAt(2).get('aBooleanField') === true);
          done();
        });
      });
    });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();
      mockFindAll('profile', 2, {description: 'dude'});

      FactoryGuy.store.findAll('profile').then(function(profiles) {
        assert.ok(profiles.get('length') === 2);
        assert.ok(profiles.get('firstObject.description') === 'dude');
        done();
      });
    });
  });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
        let done = assert.async();
        mockFindAll('profile', 'goofy_description', {description: 'foo'}, ['goofy_description', {aBooleanField: true}]);

        FactoryGuy.store.findAll('profile').then(function(profiles) {
          assert.ok(profiles.get('length') === 3);
          assert.ok(A(profiles).objectAt(0).get('description') === 'goofy');
          assert.ok(A(profiles).objectAt(0).get('aBooleanField') === false);
          assert.ok(A(profiles).objectAt(1).get('description') === 'foo');
          assert.ok(A(profiles).objectAt(1).get('aBooleanField') === false);
          assert.ok(A(profiles).objectAt(2).get('description') === 'goofy');
          assert.ok(A(profiles).objectAt(2).get('aBooleanField') === true);
          done();
        });
      });
    });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
        let done = assert.async();

        mockFindAll('comic-book', 2, 'marvel');

        FactoryGuy.store.findAll('comic-book').then(function(comics) {
          assert.ok(comics.mapBy('name') + '' === ['Comic Times #1', 'Comic Times #2'] + '');
          assert.ok(comics.mapBy('company.name') + '' === ['Marvel Comics', 'Marvel Comics'] + '');
          done();
        });
      });
    });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
        let done = assert.async();
        mockFindAll('profile', 2, 'with_company', 'with_bat_man');

        FactoryGuy.store.findAll('profile').then(function(profiles) {
          assert.ok(profiles.get('length') === 2);
          assert.ok(profiles.get('firstObject.company.name') === 'Silly corp');
          assert.ok(profiles.get('lastObject.superHero.name') === 'BatMan');
          done();
        });
      });
    });
github danielspaniel / ember-data-factory-guy / tests / unit / shared-adapter-behaviour.js View on Github external
run(() => {
      let done = assert.async();

      mockFindAll('profile', 1);

      FactoryGuy.store.findAll('profile').then(function(profiles) {
        assert.ok(profiles.get('firstObject.camelCaseDescription') === 'textGoesHere');
        assert.ok(profiles.get('firstObject.snake_case_description') === 'text_goes_here');
        done();
      });
    });
  });