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

Commit

Permalink
Update ttw tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Apr 3, 2017
1 parent 8799c69 commit 8eba761
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/gratipay/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Gratipay.packages = {};
Gratipay.packages.post = function(e) {
e.preventDefault();
var $this = $(this);
var action = 'add-email-and-claim-package';
var action = 'start-verification';
var package_id = $('input[name=package_id]').val();
var email = $('input[name=email]:checked').val();

Expand Down
11 changes: 6 additions & 5 deletions tests/ttw/test_package_claiming.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ def check(self, choice=0):
self.css('input[type=radio]')[choice].click()
self.css('button')[0].click()
assert self.has_element('.notification.notification-success', 1)
assert self.has_text('Check [email protected] for a confirmation link.')
assert self.has_text('Check your inbox for a verification link.')
return self.db.one('select address from claims c join emails e on c.nonce = e.nonce')

def test_appears_to_work(self):
self.make_package()
self.check()
assert self.check() == '[email protected]'

def test_works_when_there_are_multiple_addresses(self):
self.make_package(emails=['[email protected]', '[email protected]'])
self.check()
assert self.check() == '[email protected]'

def test_can_send_to_second_email(self):
self.make_package(emails=['bob@example.com', 'alice@example.com'])
self.check(choice=1)
self.make_package(emails=['alice@example.com', 'bob@example.com'])
assert self.check(choice=1) == '[email protected]'

0 comments on commit 8eba761

Please sign in to comment.