aboutsummaryrefslogtreecommitdiffstats
path: root/t/Mock
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-09-20 14:36:12 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-09-30 15:04:06 +0100
commitd0ae2a420905dbd0b79141d88e2c47956d1d65b2 (patch)
treec6d7abbb7a33fef2fa3af9c5684d61a6adf0eb1f /t/Mock
parentbfdae700a840b74595bb4798ae6d50bb9172fa72 (diff)
Add ability to log in on /auth via text.
A confirmation code is sent via Twilio to be entered on the site.
Diffstat (limited to 't/Mock')
-rw-r--r--t/Mock/Twilio.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/Mock/Twilio.pm b/t/Mock/Twilio.pm
new file mode 100644
index 000000000..b35166704
--- /dev/null
+++ b/t/Mock/Twilio.pm
@@ -0,0 +1,20 @@
+package t::Mock::Twilio;
+
+use Web::Simple;
+
+has texts => (
+ is => 'ro',
+ default => sub { [] },
+);
+
+sub dispatch_request {
+ my $self = shift;
+
+ sub (POST + /2010-04-01/Accounts/*/Messages.json + %*) {
+ my ($self, $sid, $data) = @_;
+ push @{$self->texts}, $data;
+ return [ 200, [ 'Content-Type' => 'application/json' ], [ '{}' ] ];
+ },
+}
+
+__PACKAGE__->run_if_script;