diff --git a/js/gratipay/sign-in.js b/js/gratipay/sign-in.js index b80f525881..1a56c75b0e 100644 --- a/js/gratipay/sign-in.js +++ b/js/gratipay/sign-in.js @@ -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() diff --git a/tests/py/test_www_email_auth.py b/tests/py/test_www_email_auth.py index 597868bf12..d1e5f7ca8b 100644 --- a/tests/py/test_www_email_auth.py +++ b/tests/py/test_www_email_auth.py @@ -11,23 +11,23 @@ class TestSendLink(Harness): def test_returns_json(self): self.make_participant('alice', email_address='alice@gratipay.com') - response = self.client.POST('/auth/send_link.json', {'email_address': 'alice@gratipay.com'}) + response = self.client.POST('/auth/send-link.json', {'email_address': 'alice@gratipay.com'}) 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': 'dummy@gratipay.com'}) + response = self.client.POST('/auth/send-link.json', {'email_address': 'dummy@gratipay.com'}) message = json.loads(response.body)['message'] assert message == "We've sent you a link to create an account. Please check your inbox." @@ -35,14 +35,14 @@ def test_400_for_invalid_email(self): class TestSendLinkEmail(QueuedEmailHarness): def test_sends_signin_email(self): self.make_participant('alice', email_address='alice@gratipay.com') - self.client.POST('/auth/send_link.json', {'email_address': 'alice@gratipay.com'}) + self.client.POST('/auth/send-link.json', {'email_address': 'alice@gratipay.com'}) assert self.get_last_email()['to'] == 'alice ' 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': 'new@gratipay.com'}) + self.client.POST('/auth/send-link.json', {'email_address': 'new@gratipay.com'}) assert self.get_last_email()['to'] == 'new@gratipay.com' assert 'Click the link below to create an account on Gratipay' in self.get_last_email()['body_text'] diff --git a/www/auth/send_link.json.spt b/www/auth/send-link.json.spt similarity index 100% rename from www/auth/send_link.json.spt rename to www/auth/send-link.json.spt