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.
Merge pull request #4550 from gratipay/dash-over-underscore
send_link → send-link
- Loading branch information
Showing
3 changed files
with
7 additions
and
7 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 |
---|---|---|
|
@@ -11,38 +11,38 @@ | |
class TestSendLink(Harness): | ||
def test_returns_json(self): | ||
self.make_participant('alice', email_address='[email protected]') | ||
response = self.client.POST('/auth/send_link.json', {'email_address': '[email protected]'}) | ||
response = self.client.POST('/auth/send-link.json', {'email_address': '[email protected]'}) | ||
|
||
message = json.loads(response.body)['message'] | ||
assert message == "We've sent you a link to sign in. Please check your inbox." | ||
|
||
def test_only_allows_post(self): | ||
response = self.client.GxT('/auth/send_link.json') | ||
response = self.client.GxT('/auth/send-link.json') | ||
|
||
assert response.code == 405 | ||
|
||
def test_400_for_no_email_address_parameter(self): | ||
response = self.client.PxST('/auth/send_link.json') | ||
response = self.client.PxST('/auth/send-link.json') | ||
|
||
assert response.code == 400 | ||
|
||
def test_400_for_invalid_email(self): | ||
response = self.client.POST('/auth/send_link.json', {'email_address': '[email protected]'}) | ||
response = self.client.POST('/auth/send-link.json', {'email_address': '[email protected]'}) | ||
|
||
message = json.loads(response.body)['message'] | ||
assert message == "We've sent you a link to create an account. Please check your inbox." | ||
|
||
class TestSendLinkEmail(QueuedEmailHarness): | ||
def test_sends_signin_email(self): | ||
self.make_participant('alice', email_address='[email protected]') | ||
self.client.POST('/auth/send_link.json', {'email_address': '[email protected]'}) | ||
self.client.POST('/auth/send-link.json', {'email_address': '[email protected]'}) | ||
|
||
assert self.get_last_email()['to'] == 'alice <[email protected]>' | ||
assert 'Click the link below to sign in to Gratipay' in self.get_last_email()['body_text'] | ||
assert 'Click the button below to sign in to Gratipay' in self.get_last_email()['body_html'] | ||
|
||
def test_sends_signup_email(self): | ||
self.client.POST('/auth/send_link.json', {'email_address': '[email protected]'}) | ||
self.client.POST('/auth/send-link.json', {'email_address': '[email protected]'}) | ||
|
||
assert self.get_last_email()['to'] == '[email protected]' | ||
assert 'Click the link below to create an account on Gratipay' in self.get_last_email()['body_text'] | ||
|
File renamed without changes.