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.
Round out confirmation form for zero and ∞
- Loading branch information
1 parent
13c1703
commit b9c4323
Showing
7 changed files
with
57 additions
and
29 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
.sorry { | ||
text-align: center; | ||
font: normal 12px/15px $Ideal; | ||
color: $medium-gray; | ||
} | ||
|
||
table.listing { | ||
width: 100%; | ||
|
||
|
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,19 @@ 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 'with one of these email addresses' in body | ||
assert 'using any email address' in body | ||
assert '[email protected]' 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 'using any email address' in body | ||
assert '[email protected]' in body | ||
assert '[email protected]' 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 email addresses" 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, choice=0): | ||
self.make_participant('bob', claimed_time='now') | ||
self.sign_in('bob') | ||
self.visit('/on/npm/foo/') | ||
self.css('input[type=radio]')[0].click() | ||
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 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(choice=1) |
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