From fd446fc5e561ae5441d422ca70dac14497b3c73e Mon Sep 17 00:00:00 2001 From: Alys Date: Sun, 23 Aug 2015 12:23:35 +1000 Subject: [PATCH 1/9] convert habitica.com to BASE_URL --- website/src/controllers/auth.js | 5 ++--- website/src/middlewares/redirects.js | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) 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 +}; From 5b8c161932a380c1aaf5d45737662631cc5d8463 Mon Sep 17 00:00:00 2001 From: Alys Date: Sun, 23 Aug 2015 12:31:10 +1000 Subject: [PATCH 2/9] changed habitrpg.wikia.com to habitica.wikia.com --- website/views/options/social/challenges.jade | 2 +- website/views/shared/profiles/achievements.jade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 From 7a9cbe2cc523558e6662d9128cc03b2762f95a0b Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 22 Aug 2015 19:15:45 -0500 Subject: [PATCH 3/9] Glob files in karma.conf --- karma.conf.js | 47 ++++------------------------------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index cd015bf9bb..898802ef63 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -42,53 +42,14 @@ module.exports = function(config) { "website/public/js/app.js", "common/script/public/config.js", - "website/public/js/services/sharedServices.js", - "website/public/js/services/notificationServices.js", "common/script/public/userServices.js", "common/script/public/directives.js", - "website/public/js/services/analyticsServices.js", - "website/public/js/services/groupServices.js", - "website/public/js/services/chatServices.js", - "website/public/js/services/memberServices.js", - "website/public/js/services/guideServices.js", - "website/public/js/services/challengeServices.js", - "website/public/js/services/taskServices.js", - "website/public/js/services/paymentServices.js", - "website/public/js/services/questServices.js", - "website/public/js/services/statServices.js", - "website/public/js/filters/money.js", - "website/public/js/filters/roundLargeNumbers.js", - "website/public/js/filters/taskOrdering.js", + "website/public/js/services/**/*.js", + "website/public/js/filters/**/*.js", + "website/public/js/directives/**/*.directive.js", + "website/public/js/controllers/**/*.js", - "website/public/js/directives/expand-menu.directive.js", - "website/public/js/directives/close-menu.directive.js", - "website/public/js/directives/focus-me.directive.js", - "website/public/js/directives/from-now.directive.js", - "website/public/js/directives/habitrpg-tasks.directive.js", - "website/public/js/directives/hrpg-sort-checklist.directive.js", - "website/public/js/directives/hrpg-sort-tags.directive.js", - "website/public/js/directives/hrpg-sort-tasks.directive.js", - "website/public/js/directives/popover-html-popup.directive.js", - "website/public/js/directives/popover-html.directive.js", - "website/public/js/directives/task-focus.directive.js", - "website/public/js/directives/when-scrolled.directive.js", - - "website/public/js/controllers/authCtrl.js", - "website/public/js/controllers/memberModalCtrl.js", - "website/public/js/controllers/menuCtrl.js", - "website/public/js/controllers/notificationCtrl.js", - "website/public/js/controllers/rootCtrl.js", - "website/public/js/controllers/settingsCtrl.js", - "website/public/js/controllers/headerCtrl.js", - "website/public/js/controllers/tasksCtrl.js", - "website/public/js/controllers/filtersCtrl.js", - "website/public/js/controllers/userCtrl.js", - "website/public/js/controllers/groupsCtrl.js", - "website/public/js/controllers/inventoryCtrl.js", - "website/public/js/controllers/footerCtrl.js", - "website/public/js/controllers/challengesCtrl.js", - "website/public/js/controllers/hallCtrl.js", 'test/spec/mocks/**/*.js', 'test/spec/specHelper.js', 'test/spec/**/*.js' From 7a43e7f90a395d36e41b726bd6ab5187875d09ff Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 22 Aug 2015 19:16:32 -0500 Subject: [PATCH 4/9] Remove mocks --- karma.conf.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 898802ef63..3c1d0e59ee 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -35,9 +35,6 @@ module.exports = function(config) { 'website/public/bower_components/js-emoji/emoji.js', 'common/dist/scripts/habitrpg-shared.js', - "test/spec/mocks/translations.js", - "test/spec/mocks/sandbox.js", - "website/public/js/env.js", "website/public/js/app.js", From 9fde84f3d092ed5676e4de5f126f21a4d346552c Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 22 Aug 2015 19:18:34 -0500 Subject: [PATCH 5/9] Remove directive --- karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 3c1d0e59ee..be380dedbb 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -44,7 +44,7 @@ module.exports = function(config) { "website/public/js/services/**/*.js", "website/public/js/filters/**/*.js", - "website/public/js/directives/**/*.directive.js", + "website/public/js/directives/**/*.js", "website/public/js/controllers/**/*.js", 'test/spec/mocks/**/*.js', From f4bc208226588e07ea91d16d75bab799ec451017 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 22 Aug 2015 19:24:23 -0500 Subject: [PATCH 6/9] Reorganize karma.conf --- karma.conf.js | 3 ++- test/spec/mocks/{sandbox.js => _sandbox.js} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename test/spec/mocks/{sandbox.js => _sandbox.js} (100%) diff --git a/karma.conf.js b/karma.conf.js index be380dedbb..ce8aacef03 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -35,6 +35,8 @@ module.exports = function(config) { 'website/public/bower_components/js-emoji/emoji.js', 'common/dist/scripts/habitrpg-shared.js', + 'test/spec/mocks/**/*.js', + "website/public/js/env.js", "website/public/js/app.js", @@ -47,7 +49,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/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 From 37859e51b79b79e31625e8da340d9a91b2e0725b Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 22 Aug 2015 19:25:34 -0500 Subject: [PATCH 7/9] Move gulp task --- tasks/gulp-tests.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/gulp-tests.js b/tasks/gulp-tests.js index c0f90f9d8f..df21ab82d2 100644 --- a/tasks/gulp-tests.js +++ b/tasks/gulp-tests.js @@ -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); } From a07d0cde850c7ab3a4086433a7bd735fa50afa78 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 22 Aug 2015 21:38:40 -0500 Subject: [PATCH 8/9] Fixed karma reporting --- tasks/gulp-tests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/gulp-tests.js b/tasks/gulp-tests.js index df21ab82d2..65621bb70e 100644 --- a/tasks/gulp-tests.js +++ b/tasks/gulp-tests.js @@ -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(); } From 8b75de56b6538f8265e924eee1665f9221dfcd5e Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 22 Aug 2015 21:40:56 -0500 Subject: [PATCH 9/9] Correct tabbing on server side specs reporting --- tasks/gulp-tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/gulp-tests.js b/tasks/gulp-tests.js index 65621bb70e..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/)