Permalink
Browse files

Test to ensure email address with + symbols are respected.

  • Loading branch information...
1 parent 15e8fe6 commit c9e4bb2459380a346ded91a17a661ea3b8b4d47f @brianloveswords brianloveswords committed Apr 10, 2012
Showing with 6 additions and 2 deletions.
  1. +2 −2 fakeissuer/static/index.html
  2. +4 −0 test/badge-model-test.js
@@ -21,11 +21,11 @@
}
unhashed.addEventListener('click', function(){
- OpenBadges.issue(['http://localhost:8889/raw.json?email=' + getEmail()]);
+ OpenBadges.issue(['http://localhost:8889/raw.json?email=' + encodeURIComponent(getEmail())]);
},false)
hashed.addEventListener('click', function(){
- OpenBadges.issue(['http://localhost:8889/hashed.json?email=' + getEmail()]);
+ OpenBadges.issue(['http://localhost:8889/hashed.json?email=' + encodeURIComponent(getEmail())]);
},false)
</script>
View
@@ -309,6 +309,10 @@ vows.describe('Badge model').addBatch({
var user = new Badge({body: {recipient: 'me@example.com'}});
assert.equal(user.confirmRecipient('me@example.com'), true);
},
+ 'should handle email with + sign': function () {
+ var user = new Badge({body: {recipient: 'me+beer@example.com'}});
+ assert.equal(user.confirmRecipient('me+beer@example.com'), true);
+ },
'return false if not given an assertion': function () {
assert.equal(Badge.confirmRecipient(null), false);
},

0 comments on commit c9e4bb2

Please sign in to comment.