Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
updating travis to support installing a local mail server
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Oct 11, 2015
1 parent eb7c4f8 commit 0017886
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions config/env/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ module.exports = {
mailer: {
from: process.env.MAILER_FROM || 'MAILER_FROM',
options: {
// The TLS configuration option is required for the test environment due
// to testing the e-mail functionality which requires that on an
// uncongifured email setup it is ok to work with unauthorized servers
tls: {
rejectUnauthorized: false
service: process.env.MAILER_SERVICE_PROVIDER || 'MAILER_SERVICE_PROVIDER',
auth: {
user: process.env.MAILER_EMAIL_ID || 'MAILER_EMAIL_ID',
pass: process.env.MAILER_PASSWORD || 'MAILER_PASSWORD'
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions modules/users/tests/server/user.server.routes.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ describe('User CRUD tests', function () {
.send({
username: user.username
})
.expect(200)
.expect(400)

This comment has been minimized.

Copy link
@vaucouleur

vaucouleur Oct 22, 2015

Contributor

@lirantal Why a 400 ? It would seem that a normal "password-reset protocol" would require a 200 ? A 400 is typically used for client errors (malformed syntax, etc.) https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error

This comment has been minimized.

Copy link
@vaucouleur

vaucouleur Oct 22, 2015

Contributor

@lirantal Nevermind. I got it. We're in the default context of a basic MEAN.JS application where the email preferences are not set, hence the 400. It's the test description that it is somewhat bit ambiguous. It is not really testing what it claims to be testing.

This comment has been minimized.

Copy link
@lirantal

lirantal Oct 29, 2015

Author Member

@vaucouleur right. We had a very long discussion about it me and @ilanbiala with the PR that introduced this change.

.end(function (err, res) {
// Handle error
if (err) {
Expand All @@ -361,7 +361,7 @@ describe('User CRUD tests', function () {
User.findOne({username: user.username.toLowerCase()}, function(err, userRes) {
userRes.resetPasswordToken.should.not.be.empty();
should.exist(userRes.resetPasswordExpires);
res.body.message.should.be.equal('An email has been sent to the provided email with further instructions.');
res.body.message.should.be.equal('Failure sending email');
return done();
});
});
Expand All @@ -377,7 +377,7 @@ describe('User CRUD tests', function () {
.send({
username: user.username
})
.expect(200)
.expect(400)
.end(function (err, res) {
// Handle error
if (err) {
Expand Down Expand Up @@ -414,7 +414,7 @@ describe('User CRUD tests', function () {
.send({
username: user.username
})
.expect(200)
.expect(400)
.end(function (err, res) {
// Handle error
if (err) {
Expand Down

0 comments on commit 0017886

Please sign in to comment.