From 186d62c9302bf7acd469316e6512ec4c054550c7 Mon Sep 17 00:00:00 2001
From: "Butler, Alexis (UG - Computer Science)" <ab02259@surrey.ac.uk>
Date: Wed, 25 Nov 2020 15:48:59 +0000
Subject: [PATCH] Helper to make app think test is running when logged in

---
 test/test_helper.rb | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/test_helper.rb b/test/test_helper.rb
index 74d7bff..6a8c76c 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -7,4 +7,8 @@ class ActiveSupport::TestCase
   fixtures :all
   # Add more helper methods to be used by all tests here...
   Rails.application.load_seed
+
+  def sign_in_as_tester
+    post login_url, params: {email: users(:one).email, password: "t00l33t4u"}
+  end
 end
-- 
GitLab