Merge branch '8784-dir-listings'
[arvados.git] / services / api / test / unit / user_notifier_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'test_helper'
6
7 class UserNotifierTest < ActionMailer::TestCase
8
9   # Send the email, then test that it got queued
10   test "account is setup" do
11     user = users :active
12     email = UserNotifier.account_is_setup user
13
14     assert_not_nil email
15
16     # Test the body of the sent email contains what we expect it to
17     assert_equal Rails.configuration.user_notifier_email_from, email.from.first
18     assert_equal user.email, email.to.first
19     assert_equal 'Welcome to Curoverse - shell account enabled', email.subject
20     assert (email.body.to_s.include? 'Your Arvados shell account has been set up'),
21         'Expected Your Arvados shell account has been set up in email body'
22     assert (email.body.to_s.include? Rails.configuration.workbench_address),
23         'Expected workbench url in email body'
24   end
25
26 end