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

Commit

Permalink
Merge pull request #4550 from gratipay/dash-over-underscore
Browse files Browse the repository at this point in the history
send_link → send-link
  • Loading branch information
aandis authored Sep 15, 2017
2 parents 114f36c + 2d73dd7 commit da7f739
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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.

0 comments on commit da7f739

Please sign in to comment.