Skip to content

Commit

Permalink
fix(server): fix seeding of db in test mode causing tests to randomly…
Browse files Browse the repository at this point in the history
… fail

seeding of db will now be disabled by default for all environments, but will be enabled for the development environment

closes #352
  • Loading branch information
DaftMonk committed Jul 17, 2014
1 parent eb7d50c commit 05f7f43
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
5 changes: 0 additions & 5 deletions app/templates/e2e/main/main.po.js
Expand Up @@ -9,11 +9,6 @@ var MainPage = function() {
this.heroEl = element(by.css('.hero-unit'));
this.h1El = this.heroEl.element(by.css('h1'));
this.imgEl = this.heroEl.element(by.css('img'));
this.anchorEl = this.heroEl.element(by.css('a'));

this.repeater = by.repeater('thing in awesomeThings');
this.firstAwesomeThingNameEl = element(this.repeater.row(0).column('{{thing.name}}'));
this.awesomeThingsCount = element.all(this.repeater).count();
};

module.exports = new MainPage();
Expand Down
7 changes: 0 additions & 7 deletions app/templates/e2e/main/main.spec.js
Expand Up @@ -13,11 +13,4 @@ describe('Main View', function() {
expect(page.imgEl.getAttribute('src')).toMatch(/assets\/images\/yeoman.png$/);
expect(page.imgEl.getAttribute('alt')).toBe('I\'m Yeoman');
});

it('should render awesomeThings', function() {
expect(page.firstAwesomeThingNameEl.getText()).toContain('Development Tools');
page.awesomeThingsCount.then(function(count) {
expect(count).toBe(6);
});
});
});
2 changes: 1 addition & 1 deletion app/templates/server/api/user(auth)/user.model.spec.js
Expand Up @@ -12,7 +12,7 @@ var user = new User({
});

describe('User Model', function() {
beforeEach(function(done) {
before(function(done) {
// Clear users before testing
User.remove().exec().then(function() {
done();
Expand Down
4 changes: 3 additions & 1 deletion app/templates/server/config/environment/development.js
Expand Up @@ -6,5 +6,7 @@ module.exports = {
// MongoDB connection options
mongo: {
uri: 'mongodb://localhost/<%= _.slugify(appname) %>-dev'
}
},

seedDB: true
};
2 changes: 1 addition & 1 deletion app/templates/server/config/environment/index.js
Expand Up @@ -22,7 +22,7 @@ var all = {
port: process.env.PORT || 9000,

// Should we populate the DB with sample data?
seedDB: true,
seedDB: false,

// Secret for session, you will want to change this and make it an environment variable
secrets: {
Expand Down

0 comments on commit 05f7f43

Please sign in to comment.