Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Make tests work under multiple notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Jun 14, 2017
1 parent ea4904c commit 5b1949f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions js/gratipay/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@ Gratipay.packages.initSingle = function() {

Gratipay.packages.postBulk = function(e) {
e.preventDefault();
var pkg, email, package_id, emails=[], package_ids_by_email={};
var pkg, email, package_id, package_ids_by_email={};
$('table.listing td.item ').not('.disabled').each(function() {
pkg = $(this).data();
if (package_ids_by_email[pkg.email] === undefined) {
emails.push(pkg.email);
if (package_ids_by_email[pkg.email] === undefined)
package_ids_by_email[pkg.email] = [];
}
package_ids_by_email[pkg.email].push(pkg.packageId);
});
emails.sort();
for (var i=0, email; email = emails[i]; i++)
for (email in package_ids_by_email)
Gratipay.packages.post(email, package_ids_by_email[email], true);
};

Expand All @@ -36,7 +33,7 @@ Gratipay.packages.postOne = function(e) {

Gratipay.packages.post = function(email, package_ids, show_email) {
var action = 'start-verification';
var $button = $('.important-button button')
var $button = $('button.apply')

$button.prop('disabled', true);
function reenable() { $button.prop('disabled', false); }
Expand Down
4 changes: 2 additions & 2 deletions tests/ttw/test_package_claiming.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def test_sends_one_mail_per_address(self):
self.add_and_verify_email(cat, '[email protected]')
self.visit_as('cat')
self.css('.important-button button').click()
assert self.wait_for_success() == 'Check [email protected] for a verification link.'
assert self.wait_for_success() == 'Check [email protected] for a verification link.'
assert self.wait_for_success('Check [email protected] for a verification link.')
assert self.wait_for_success('Check [email protected] for a verification link.')

def test_sends_one_mail_for_multiple_packages(self):
self.make_participant('alice', claimed_time='now', email_address='[email protected]')
Expand Down

0 comments on commit 5b1949f

Please sign in to comment.