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

Commit

Permalink
Failing ttw test for sending a confirmation link
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Jan 25, 2017
1 parent 8fb44a7 commit 6a4b1a1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gratipay/testing/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=['[email protected]']):
"""Factory for packages.
"""
self.db.one( 'INSERT INTO packages (package_manager, name, description, emails) '
Expand Down
2 changes: 1 addition & 1 deletion tests/py/test_www_npm_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class TestClaimingWorkflow(Harness):

def setUp(self):
self.make_package('npm', 'foo', 'The foo package', ['[email protected]'])
self.make_package()

def test_anon_gets_signin_page_from_unclaimed(self):
body = self.client.GET('/on/npm/foo/').body
Expand Down
17 changes: 17 additions & 0 deletions tests/ttw/test_package_claiming.py
Original file line number Diff line number Diff line change
@@ -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')
2 changes: 1 addition & 1 deletion www/on/npm/%package/index.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ url = 'https://npmjs.com/package/' + package.name
<form action="" method="POST">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<ul>
{% for email in emails %}
{% for email in package.emails %}
<li><input type="radio" name="email"> {{ email }}</li>
{% endfor %}
</ul>
Expand Down

0 comments on commit 6a4b1a1

Please sign in to comment.