summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-15 19:13:26 +0100
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-15 19:16:16 +0100
commit59064aeeef8562a87d4d03efa9b11012a007e261 (patch)
tree1ecb34e1355a4eb714615b2a9c2727155e8f3ec9 /spec/support
parentaaf4434b0e24da916d4392aa9cd001cdb8e0c7dc (diff)
parentbc590ce63bd2f1af5545b648e6d028a557e7c792 (diff)
downloadgitlab-ce-59064aeeef8562a87d4d03efa9b11012a007e261.tar.gz
Merge branch 'master' into 4009-external-users4009-external-users
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/email_helpers.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/email_helpers.rb b/spec/support/email_helpers.rb
new file mode 100644
index 00000000000..a85ab22ce36
--- /dev/null
+++ b/spec/support/email_helpers.rb
@@ -0,0 +1,13 @@
+module EmailHelpers
+ def sent_to_user?(user)
+ ActionMailer::Base.deliveries.map(&:to).flatten.count(user.email) == 1
+ end
+
+ def should_email(user)
+ expect(sent_to_user?(user)).to be_truthy
+ end
+
+ def should_not_email(user)
+ expect(sent_to_user?(user)).to be_falsey
+ end
+end