DEV: Move imap_helper to spec/support directory (#14776)

DEV: Move imap_helper to spec/support directory (#14776)

diff --git a/spec/components/imap/imap_helper.rb b/spec/components/imap/imap_helper.rb
deleted file mode 100644
index 6407a54..0000000
--- a/spec/components/imap/imap_helper.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class MockedImapProvider < Imap::Providers::Gmail
-  def connect!; end
-  def disconnect!; end
-  def open_mailbox(mailbox_name, write: false); end
-
-  def labels
-    ['INBOX']
-  end
-end
-
-def EmailFabricator(options)
-  email = +''
-  email += "Date: Sat, 31 Mar 2018 17:50:19 -0700\n"
-  email += "From: #{options[:from] || "Dan <dan@discourse.org>"}\n"
-  email += "To: #{options[:to] || "Joffrey <joffrey@discourse.org>"}\n"
-  email += "Cc: #{options[:cc]}\n" if options[:cc]
-  email += "In-Reply-To: #{options[:in_reply_to]}\n" if options[:in_reply_to]
-  email += "References: #{options[:in_reply_to]}\n" if options[:in_reply_to]
-  email += "Message-ID: <#{options[:message_id]}>\n" if options[:message_id]
-  email += "Subject: #{options[:subject] || "This is a test email subject"}\n"
-  email += "Mime-Version: 1.0\n"
-  email += "Content-Type: #{options[:content_type] || "text/plain;\n charset=UTF-8"}\n"
-  email += "Content-Transfer-Encoding: 7bit\n"
-  email += "\n#{options[:body] || "This is an email *body*. :smile:"}"
-  email
-end
diff --git a/spec/components/imap/sync_spec.rb b/spec/components/imap/sync_spec.rb
index 04ee4eb..3c49490 100644
--- a/spec/components/imap/sync_spec.rb
+++ b/spec/components/imap/sync_spec.rb
@@ -2,7 +2,6 @@
 
 require 'rails_helper'
 require 'imap/sync'
-require_relative 'imap_helper'
 
 describe Imap::Sync do
 
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 7f4aed0..0bd4eff 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -1,7 +1,6 @@
 # frozen_string_literal: true
 
 require 'rails_helper'
-require_relative '../components/imap/imap_helper'
 
 describe Group do
   let(:admin) { Fabricate(:admin) }
diff --git a/spec/support/imap_helper.rb b/spec/support/imap_helper.rb
new file mode 100644
index 0000000..6407a54
--- /dev/null
+++ b/spec/support/imap_helper.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class MockedImapProvider < Imap::Providers::Gmail
+  def connect!; end
+  def disconnect!; end
+  def open_mailbox(mailbox_name, write: false); end
+
+  def labels
+    ['INBOX']
+  end
+end
+
+def EmailFabricator(options)
+  email = +''
+  email += "Date: Sat, 31 Mar 2018 17:50:19 -0700\n"
+  email += "From: #{options[:from] || "Dan <dan@discourse.org>"}\n"
+  email += "To: #{options[:to] || "Joffrey <joffrey@discourse.org>"}\n"
+  email += "Cc: #{options[:cc]}\n" if options[:cc]
+  email += "In-Reply-To: #{options[:in_reply_to]}\n" if options[:in_reply_to]
+  email += "References: #{options[:in_reply_to]}\n" if options[:in_reply_to]
+  email += "Message-ID: <#{options[:message_id]}>\n" if options[:message_id]
+  email += "Subject: #{options[:subject] || "This is a test email subject"}\n"
+  email += "Mime-Version: 1.0\n"
+  email += "Content-Type: #{options[:content_type] || "text/plain;\n charset=UTF-8"}\n"
+  email += "Content-Transfer-Encoding: 7bit\n"
+  email += "\n#{options[:body] || "This is an email *body*. :smile:"}"
+  email
+end

GitHub sha: ab374fff72e82a966745cffa0434f1d1b18fd46d

This commit appears in #14776 which was approved by eviltrout. It was merged by CvX.