Skip to content

Commit 180dc63

Browse files
committed
2 parents 5eb3bb0 + d3fa78c commit 180dc63

27 files changed

+135
-143
lines changed

app/index.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
2626

2727
this.filters = {};
2828

29-
// dynamic assertion statement
30-
this.does = this.is = function(foo) {
31-
foo = this.engine(foo.replace(/\(;>%%<;\)/g, '<%')
32-
.replace(/\(;>%<;\)/g, '%>'), this);
33-
if (this.filters.should) {
34-
return foo + '.should';
35-
} else {
36-
return 'expect(' + foo + ').to';
37-
}
29+
// dynamic assertion statements
30+
this.expect = function() {
31+
return this.filters.expect ? 'expect(' : '';
32+
}.bind(this);
33+
this.to = function() {
34+
return this.filters.expect ? ').to' : '.should';
3835
}.bind(this);
3936
},
4037

app/templates/client/app/account(auth)/login/login(html).html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<div class="row">
55
<div class="col-sm-12">
66
<h1>Login</h1>
7-
<p>Accounts are reset on server restart from <code>server/config/seed.js</code>. Default account is <code>test@test.com</code> / <code>test</code></p>
8-
<p>Admin account is <code>admin@admin.com</code> / <code>admin</code></p>
7+
<p>Accounts are reset on server restart from <code>server/config/seed.js</code>. Default account is <code>test@example.com</code> / <code>test</code></p>
8+
<p>Admin account is <code>admin@example.com</code> / <code>admin</code></p>
99
</div>
1010
<div class="col-sm-12">
1111
<form class="form" name="form" ng-submit="login(form)" novalidate>

app/templates/client/app/account(auth)/login/login(jade).jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ navbar
77
| Accounts are reset on server restart from
88
code server/config/seed.js
99
| . Default account is
10-
code test@test.com
10+
code test@example.com
1111
| /
1212
code test
1313
p
1414
| Admin account is
15-
code admin@admin.com
15+
code admin@example.com
1616
| /
1717
code admin
1818

app/templates/client/app/admin(auth)/admin.controller(coffee).coffee

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
angular.module '<%= scriptAppName %>'
44
.controller 'AdminCtrl', ($scope, $http, Auth, User) ->
55

6-
$http.get '/api/users'
7-
.success (users) ->
8-
$scope.users = users
6+
$scope.users = User.query()
97

108
$scope.delete = (user) ->
119
User.remove id: user._id

app/templates/client/app/main/main.controller(coffee).coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ angular.module '<%= scriptAppName %>'
44
.controller 'MainCtrl', ($scope, $http<% if (filters.socketio) { %>, socket<% } %>) ->
55
$scope.awesomeThings = []
66

7-
$http.get('/api/things').success (awesomeThings) ->
8-
$scope.awesomeThings = awesomeThings
7+
$http.get('/api/things').then (response) ->
8+
$scope.awesomeThings = response.data
99
<% if (filters.socketio) { %>socket.syncUpdates 'thing', $scope.awesomeThings<% } %>
1010
<% if (filters.models) { %>
1111
$scope.addThing = ->

app/templates/client/app/main/main.controller(js).js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ angular.module('<%= scriptAppName %>')
44
.controller('MainCtrl', function($scope, $http<% if (filters.socketio) { %>, socket<% } %>) {
55
$scope.awesomeThings = [];
66

7-
$http.get('/api/things').success(function(awesomeThings) {
8-
$scope.awesomeThings = awesomeThings;<% if (filters.socketio) { %>
7+
$http.get('/api/things').then(function(response) {
8+
$scope.awesomeThings = response.data;<% if (filters.socketio) { %>
99
socket.syncUpdates('thing', $scope.awesomeThings);<% } %>
1010
});
1111
<% if (filters.models) { %>

app/templates/client/app/main/main.controller.spec(coffee).coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ describe 'Controller: MainCtrl', ->
2929
it 'should attach a list of things to the scope', ->
3030
$httpBackend.flush()<% if (filters.jasmine) { %>
3131
expect(scope.awesomeThings.length).toBe 4 <% } if (filters.mocha) { %>
32-
<%= does("scope.awesomeThings.length") %>.equal 4<% } %>
32+
<%= expect() %>scope.awesomeThings.length<%= to() %>.equal 4<% } %>

app/templates/client/app/main/main.controller.spec(js).js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ describe('Controller: MainCtrl', function() {
2828
it('should attach a list of things to the scope', function() {
2929
$httpBackend.flush();<% if (filters.jasmine) { %>
3030
expect(scope.awesomeThings.length).toBe(4);<% } if (filters.mocha) { %>
31-
<%= does("scope.awesomeThings.length") %>.equal(4);<% } %>
31+
<%= expect() %>scope.awesomeThings.length<%= to() %>.equal(4);<% } %>
3232
});
3333
});

app/templates/client/components/auth(auth)/user.service(js).js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ angular.module('<%= scriptAppName %>')
1818
id:'me'
1919
}
2020
}
21-
});
21+
});
2222
});

app/templates/e2e/account(auth)/login/login.spec(jasmine).js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('Login View', function() {
1414

1515
var testUser = {
1616
name: 'Test User',
17-
email: 'test@test.com',
17+
email: 'test@example.com',
1818
password: 'test'
1919
};
2020

0 commit comments

Comments
 (0)