From b027e2c40750275cf0674bfb9706b3510d3e8312 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Mon, 13 Apr 2015 17:22:24 -0500 Subject: [PATCH 1/2] Corrected port and db to use --- test/api.mocha.coffee | 6 +++--- website/src/utils.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/api.mocha.coffee b/test/api.mocha.coffee index d5f971bfda..5b54e6052c 100644 --- a/test/api.mocha.coffee +++ b/test/api.mocha.coffee @@ -12,13 +12,13 @@ path = require("path") moment = require("moment") conf = require("nconf") conf.argv().env().file(file: path.join(__dirname, "../config.json")).defaults() -conf.set "port", "1337" +conf.set "PORT", "1337" # Override normal ENV values with nconf ENV values (ENV values are used the same way without nconf) process.env.BASE_URL = conf.get("BASE_URL") process.env.FACEBOOK_KEY = conf.get("FACEBOOK_KEY") process.env.FACEBOOK_SECRET = conf.get("FACEBOOK_SECRET") -process.env.NODE_DB_URI = "mongodb://localhost/habitrpg" +process.env.NODE_DB_URI = "mongodb://localhost/habitrpg_test" User = require("../website/src/models/user").model Group = require("../website/src/models/group").model Challenge = require("../website/src/models/challenge").model @@ -30,7 +30,7 @@ payments = require("../website/src/controllers/payments") model = undefined uuid = undefined taskPath = undefined -baseURL = "http://localhost:3000/api/v2" +baseURL = "http://localhost:" + conf.get("PORT") + "/api/v2" expectCode = (res, code) -> expect(res.body.err).to.be `undefined` if code is 200 expect(res.statusCode).to.be code diff --git a/website/src/utils.js b/website/src/utils.js index c2e0085087..cefb9cab8c 100644 --- a/website/src/utils.js +++ b/website/src/utils.js @@ -114,7 +114,7 @@ module.exports.txnEmail = function(mailingInfoArray, emailType, variables, perso { name: 'RECIPIENT_UNSUB_URL', content: baseUrl + '/unsubscribe?code=' + module.exports.encrypt(JSON.stringify({ - _id: temporaryPersonalVariables[singlePersonalVariables.rcpt]._id, + _id: temporaryPersonalVariables[singlePersonalVariables.rcpt]._id, email: singlePersonalVariables.rcpt })) } From 83858da25e0d26704195308ebb9ace3b7a061a71 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Tue, 14 Apr 2015 08:11:39 -0500 Subject: [PATCH 2/2] Change button to be more specific --- test/e2e/e2e.js | 8 ++++---- website/views/static/front.jade | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/e2e/e2e.js b/test/e2e/e2e.js index d2b6a25665..53fb6f5189 100644 --- a/test/e2e/e2e.js +++ b/test/e2e/e2e.js @@ -24,12 +24,12 @@ describe('front page', function() { }); it('shows the front page', function(){ - var button = element(by.className('btn')); - expect(button.getText()).toEqual('Play HabitRPG'); + var button = element(by.id('play-btn')); + expect(button.getText()).toEqual('Play for free'); }); it("don't login when using wrong credentials", function(){ - var button = element(by.className('btn')); + var button = element(by.id('play-btn')); button.click(); browser.sleep(1000); element(by.model('loginUsername')).sendKeys('username'); @@ -42,7 +42,7 @@ describe('front page', function() { }); xit('registers a new user', function(){ - var button = element(by.className('btn')); + var button = element(by.id('play-btn')); button.click(); browser.sleep(1000); var registerTab = element(by.linkText('Register')); diff --git a/website/views/static/front.jade b/website/views/static/front.jade index 30b5778ef6..20686466d6 100644 --- a/website/views/static/front.jade +++ b/website/views/static/front.jade @@ -72,7 +72,7 @@ html(ng-app='habitrpg', ng-controller='RootCtrl') h4 | Join 200,000 players making it fun to achieve goals! small - button.btn.btn-primary.btn-lg.gamifybutton(ng-click='playButtonClick()') Play for free + button#play-btn.btn.btn-primary.btn-lg.gamifybutton(ng-click='playButtonClick()') Play for free .presslogos.text-center | Featured in br @@ -303,7 +303,7 @@ html(ng-app='habitrpg', ng-controller='RootCtrl') div(style='width:100%; background-color: #d9ead3; color: rgb(51, 51, 51); text-align:center; padding: 0px; line-height: 1.62765; list-style: none outside none; padding: 0px; height: 2.3em; min-height: 1.62765em; margin-bottom:0.75em; margin:0px; box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.5) inset;') .task-btn(style='display: inline-block; width: 1.62765em; height: 1.62765em; padding: 0px; margin:0px; line-height: 1.62765; text-align: center; color: rgb(34, 34, 34); float:left; cursor: pointer; vertical-align: top; left:0px; position:relative; background-color: rgb(113, 176, 91); border-right: 1px solid rgba(0, 0, 0, 0.25);') + |   - .task-desc(style='display: inline-block; font-family: Lato,sans-serif; padding: 0.6em 0px 0em 1em; letter-spacing: normal; float:left; word-wrap: break-word;') Study 1 hour + .task-desc(style='display: inline-block; font-family: Lato,sans-serif; padding: 0.6em 0px 0em 1em; letter-spacing: normal; float:left; word-wrap: break-word;') Study 1 hour br div(style='width:100%; background-color: rgb(255, 242, 204); color: rgb(51, 51, 51); text-align:center; padding: 0px; line-height: 1.62765; list-style: none outside none; padding: 0px; height: 2.3em; min-height: 1.62765em; margin-bottom:0.75em; margin:0px; box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.5) inset;') .task-btn(style='display: inline-block; width: 1.62765em; height: 1.62765em; padding: 0px; margin:0px; line-height: 1.62765; text-align: center; color: rgb(34, 34, 34); float:left; cursor: pointer; vertical-align: top; left:0px; position:relative; background-color: rgb(255, 207, 66); border-right: 1px solid rgba(0, 0, 0, 0.25);') + @@ -642,4 +642,4 @@ html(ng-app='habitrpg', ng-controller='RootCtrl') .controller('CarouselController', ['$scope', '$timeout', '$transition', '$q', function ($scope, $timeout, $transition, $q) { }]).directive('carousel', [function () { return {} - }]); \ No newline at end of file + }]);