+ # Button text changes to "sending...", then back to normal. In the
+ # test suite we can't depend on confirming the "sending..." state
+ # before it goes back to normal, though.
+ ## assert_selector 'a', text: 'Sending request...'
+ assert_selector 'a', text: 'Send request for shell access'
+ assert_text 'A request for shell access was sent'
+
+ # verify that the email was sent
+ user = api_fixture('users')['spectator']
+ full_name = "#{user['first_name']} #{user['last_name']}"
+ expected = "Shell account request from #{full_name} (#{user['email']}, #{user['uuid']})"
+ found_email = 0
+ ActionMailer::Base.deliveries.each do |email|
+ if email.subject.include?(expected)
+ found_email += 1
+ end
+ end
+ assert_equal 1, found_email, "Expected email after requesting shell access"
+
+ # Revisit the page and verify the request sent message along with
+ # the request button.