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

send_link → send-link #4550

Merged
merged 1 commit into from
Sep 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/gratipay/sign-in.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gratipay.signIn.wireUpEmailInput = function() {
$('#sign-in-modal form.email-form').submit(function(e) {
e.preventDefault();
jQuery.ajax({
url: '/auth/send_link.json',
url: '/auth/send-link.json',
type: 'POST',
data: {
'email_address': $(this).find('input').val()
Expand Down
12 changes: 6 additions & 6 deletions tests/py/test_www_email_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
File renamed without changes.