diff --git a/gratipay/testing/harness.py b/gratipay/testing/harness.py index fb9da6c765..379691cc10 100644 --- a/gratipay/testing/harness.py +++ b/gratipay/testing/harness.py @@ -181,7 +181,8 @@ def make_team(self, *a, **kw): return team - def make_package(self, package_manager, name, description, emails): + def make_package(self, package_manager='npm', name='foo', description='Foo', + emails=['alice@example.com']): """Factory for packages. """ self.db.one( 'INSERT INTO packages (package_manager, name, description, emails) ' diff --git a/tests/py/test_www_npm_package.py b/tests/py/test_www_npm_package.py index 1e7fa6527a..35645f49b2 100644 --- a/tests/py/test_www_npm_package.py +++ b/tests/py/test_www_npm_package.py @@ -7,7 +7,7 @@ class TestClaimingWorkflow(Harness): def setUp(self): - self.make_package('npm', 'foo', 'The foo package', ['alice@example.com']) + self.make_package() def test_anon_gets_signin_page_from_unclaimed(self): body = self.client.GET('/on/npm/foo/').body diff --git a/tests/ttw/test_package_claiming.py b/tests/ttw/test_package_claiming.py new file mode 100644 index 0000000000..4d6a9b7c86 --- /dev/null +++ b/tests/ttw/test_package_claiming.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + +from gratipay.testing import BrowserHarness + + +class Tests(BrowserHarness): + + def test_sending_a_confirmation_email_works(self): + self.make_package() + self.make_participant('alice', claimed_time='now') + self.sign_in('alice') + self.visit('/on/npm/foo/') + self.css('input[type=radio]').click() + self.css('button').click() + assert self.has_element('.notification.notification-success', 1) + assert self.has_text('A confirmation email has been sent') diff --git a/www/on/npm/%package/index.html.spt b/www/on/npm/%package/index.html.spt index c900d060a7..550dfced34 100644 --- a/www/on/npm/%package/index.html.spt +++ b/www/on/npm/%package/index.html.spt @@ -43,7 +43,7 @@ url = 'https://npmjs.com/package/' + package.name