aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-05-14 11:53:40 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-05-23 18:55:09 +0100
commit910b1b8fef7e19b102459c97fc700a117d7a12aa (patch)
tree81d163980e8beb9c6dc05773ffbe52dc0ab5a36b /t
parent110a80eff22e852974bc5a6f90295803ef7e0de6 (diff)
Refactor out some session functions.
Diffstat (limited to 't')
-rw-r--r--t/app/model/session.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/app/model/session.t b/t/app/model/session.t
new file mode 100644
index 000000000..f76533727
--- /dev/null
+++ b/t/app/model/session.t
@@ -0,0 +1,14 @@
+use FixMyStreet::TestMech;
+
+my $mech = FixMyStreet::TestMech->new;
+
+$mech->log_in_ok('test@example.com');
+
+my $session = FixMyStreet::DB->resultset("Session")->first;
+
+my $id = $session->id;
+$id =~ s/\s+$//;
+is $id, "session:" . $session->id_code;
+is $session->user->email, 'test@example.com';
+
+done_testing;