This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shelve work on multiple email support
- Loading branch information
1 parent
13c1703
commit 67ad75a
Showing
5 changed files
with
70 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,16 @@ def test_auth_gets_send_confirmation_page_from_unclaimed(self): | |
self.make_participant('bob', claimed_time='now') | ||
body = self.client.GET('/on/npm/foo/', auth_as='bob').body | ||
assert 'npm/foo</a> has not been claimed' in body | ||
assert 'using <b>[email protected]</b>' in body | ||
|
||
def test_auth_gets_multiple_options_if_present(self): | ||
self.make_package('npm', 'bar', 'Bar', ['[email protected]', '[email protected]']) | ||
self.make_participant('bob', claimed_time='now') | ||
body = self.client.GET('/on/npm/bar/', auth_as='bob').body | ||
assert 'with one of these email addresses' in body | ||
|
||
def test_auth_gets_something_if_no_emails(self): | ||
self.make_package('npm', 'bar', 'Bar', []) | ||
self.make_participant('bob', claimed_time='now') | ||
body = self.client.GET('/on/npm/bar/', auth_as='bob').body | ||
assert "didn't find any emails" in body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,25 @@ | |
from gratipay.testing import BrowserHarness | ||
|
||
|
||
class Tests(BrowserHarness): | ||
class TestSendConfirmationLink(BrowserHarness): | ||
|
||
def test_sending_a_confirmation_email_appears_to_work(self): | ||
self.make_package() | ||
def check(self, extra_action=None): | ||
self.make_participant('bob', claimed_time='now') | ||
self.sign_in('bob') | ||
self.visit('/on/npm/foo/') | ||
self.css('input[type=radio]')[0].click() | ||
extra_action() if extra_action else '' | ||
self.css('button')[0].click() | ||
assert self.has_element('.notification.notification-success', 1) | ||
assert self.has_text('Check [email protected] for a confirmation email.') | ||
assert self.has_text('Check [email protected] for a confirmation link.') | ||
|
||
def test_appears_to_work(self): | ||
self.make_package() | ||
self.check() | ||
|
||
def test_works_when_there_are_multiple_addresses(self): | ||
self.make_package(emails=['[email protected]', '[email protected]']) | ||
self.check() | ||
|
||
def test_can_send_to_second_email(self): | ||
self.make_package(emails=['[email protected]', '[email protected]']) | ||
self.check(extra_action=lambda: self.css('input[type=radio]')[1].click()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters