diff --git a/karma.conf.js b/karma.conf.js index be380dedbb..6af0403ebd 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -35,8 +35,9 @@ module.exports = function(config) { 'website/public/bower_components/js-emoji/emoji.js', 'common/dist/scripts/habitrpg-shared.js', - "website/public/js/env.js", + 'test/spec/mocks/**/*.js', + "website/public/js/env.js", "website/public/js/app.js", "common/script/public/config.js", "common/script/public/userServices.js", @@ -47,7 +48,6 @@ module.exports = function(config) { "website/public/js/directives/**/*.js", "website/public/js/controllers/**/*.js", - 'test/spec/mocks/**/*.js', 'test/spec/specHelper.js', 'test/spec/**/*.js' ], diff --git a/tasks/gulp-tests.js b/tasks/gulp-tests.js index c0f90f9d8f..e3b469a9a2 100644 --- a/tasks/gulp-tests.js +++ b/tasks/gulp-tests.js @@ -93,7 +93,7 @@ gulp.task('test:server_side:safe', ['test:prepare:build'], (cb) => { testBin('mocha test/server_side'), (err, stdout, stderr) => { testResults.push({ - suite: 'Server Side Specs\t', + suite: 'Server Side Specs', pass: testCount(stdout, /(\d+) passing/), fail: testCount(stderr, /(\d+) failing/), pend: testCount(stdout, /(\d+) pending/) @@ -141,9 +141,9 @@ gulp.task('test:api:watch', [ gulp.watch(['website/src/**', 'test/api/**'], ['test:api:clean']); }); -gulp.task('test:karma:watch', ['test:prepare:build'], (cb) => { +gulp.task('test:karma', ['test:prepare:build'], (cb) => { let runner = exec( - testBin('karma start'), + testBin('karma start --single-run'), (err, stdout) => { cb(err); } @@ -151,9 +151,9 @@ gulp.task('test:karma:watch', ['test:prepare:build'], (cb) => { pipe(runner); }); -gulp.task('test:karma', ['test:prepare:build'], (cb) => { +gulp.task('test:karma:watch', ['test:prepare:build'], (cb) => { let runner = exec( - testBin('karma start --single-run'), + testBin('karma start'), (err, stdout) => { cb(err); } @@ -167,9 +167,9 @@ gulp.task('test:karma:safe', ['test:prepare:build'], (cb) => { (err, stdout) => { testResults.push({ suite: 'Karma Specs\t', - pass: testCount(stdout, /(\d+) tests completed/), - fail: testCount(stdout, /(\d+) tests failed/), - pend: testCount(stdout, /(\d+) tests skipped/) + pass: testCount(stdout, /(\d+) tests? completed/), + fail: testCount(stdout, /(\d+) tests? failed/), + pend: testCount(stdout, /(\d+) tests? skipped/) }); cb(); } diff --git a/test/spec/mocks/sandbox.js b/test/spec/mocks/_sandbox.js similarity index 100% rename from test/spec/mocks/sandbox.js rename to test/spec/mocks/_sandbox.js diff --git a/website/src/controllers/auth.js b/website/src/controllers/auth.js index 440ee9fed6..023adb0eec 100644 --- a/website/src/controllers/auth.js +++ b/website/src/controllers/auth.js @@ -246,10 +246,9 @@ api.resetPassword = function(req, res, next){ from: "Habitica ", to: email, subject: "Password Reset for Habitica", - text: "Password for " + user.auth.local.username + " has been reset to " + newPassword + " Important! Both username and password are case-sensitive -- you must enter both exactly as shown here. We recommend copying and pasting both instead of typing them. Log in at https://habitica.com/. After you've logged in, head to https://habitica.com/#/options/settings/settings and change your password.", - html: "Password for " + user.auth.local.username + " has been reset to " + newPassword + "

Important! Both username and password are case-sensitive -- you must enter both exactly as shown here. We recommend copying and pasting both instead of typing them.

Log in at https://habitica.com/. After you've logged in, head to https://habitica.com/#/options/settings/settings and change your password." + text: "Password for " + user.auth.local.username + " has been reset to " + newPassword + " Important! Both username and password are case-sensitive -- you must enter both exactly as shown here. We recommend copying and pasting both instead of typing them. Log in at " + nconf.get('BASE_URL') + ". After you've logged in, head to " + nconf.get('BASE_URL') + "/#/options/settings/settings and change your password.", + html: "Password for " + user.auth.local.username + " has been reset to " + newPassword + "

Important! Both username and password are case-sensitive -- you must enter both exactly as shown here. We recommend copying and pasting both instead of typing them.

Log in at " + nconf.get('BASE_URL') + ". After you've logged in, head to " + nconf.get('BASE_URL') + "/#/options/settings/settings and change your password." }); - // TODO: change all four instances of habitica.com above to use BASE_URL when it has been updated. Previous version: https://github.com/HabitRPG/habitrpg/blob/2069936603aca7f8139a6c98e063136248262bdf/website/src/controllers/auth.js#L249 user.save(function(err){ if(err) return next(err); res.send('New password sent to '+ email); diff --git a/website/src/middlewares/redirects.js b/website/src/middlewares/redirects.js index 25b8d44fa9..cb2fb7fc50 100644 --- a/website/src/middlewares/redirects.js +++ b/website/src/middlewares/redirects.js @@ -28,8 +28,6 @@ module.exports.forceSSL = function(req, res, next){ }; // Redirect to habitica for non-api urls -// NOTE: Currently using a static 'habitica.com' string, rather than BASE_URL, -// to make rollback easy. Eventually, BASE_URL should be migrated. function nonApiUrl(req) { return req.url.search(/\/api\//) === -1; @@ -37,7 +35,7 @@ function nonApiUrl(req) { module.exports.forceHabitica = function(req, res, next) { if (IS_PROD && !ignoreRedirect && !isProxied(req) && nonApiUrl(req)) { - return res.redirect('https://habitica.com' + req.url); + return res.redirect(BASE_URL + req.url); } next(); -}; \ No newline at end of file +}; diff --git a/website/views/options/social/challenges.jade b/website/views/options/social/challenges.jade index fd1ccd7549..555b188eeb 100644 --- a/website/views/options/social/challenges.jade +++ b/website/views/options/social/challenges.jade @@ -144,7 +144,7 @@ script(type='text/ng-template', id='partials/options.social.challenges.html') ng-model='newChallenge.shortName', placeholder=env.t('challengeTag'), required ng-disabled='insufficientGemsForTavernChallenge()') |  - a.hint.vertical-20(target='_blank', href='http://habitrpg.wikia.com/wiki/Tags', + a.hint.vertical-20(target='_blank', href='http://habitica.wikia.com/wiki/Tags', popover=env.t('challengeTagPop'), popover-trigger='mouseenter', popover-placement='right') =env.t('moreInfo') diff --git a/website/views/shared/profiles/achievements.jade b/website/views/shared/profiles/achievements.jade index ed9df8ac24..11ec0437a9 100644 --- a/website/views/shared/profiles/achievements.jade +++ b/website/views/shared/profiles/achievements.jade @@ -29,7 +29,7 @@ div(ng-if='::profile.contributor.level || user._id == profile._id') small =env.t('contribText') |  - +aLink('http://habitrpg.wikia.com/wiki/Contributing_to_HabitRPG', env.t('readMore')) + +aLink('http://habitica.wikia.com/wiki/Contributing_to_Habitica', env.t('readMore')) | . hr