コード例 #1
0
			It("does not send any non-critical notifications", func() {
				Expect(mailClient.SendCall.CallCount).To(Equal(0))
			})

			It("updates the message status as undeliverable", func() {
				Expect(messageStatusUpdater.UpdateCall.Receives.Connection).To(Equal(conn))
				Expect(messageStatusUpdater.UpdateCall.Receives.MessageID).To(Equal(messageID))
				Expect(messageStatusUpdater.UpdateCall.Receives.MessageStatus).To(Equal(postal.StatusUndeliverable))
				Expect(messageStatusUpdater.UpdateCall.Receives.Logger.SessionName()).To(Equal("notifications.worker"))
			})
		})

		Context("when the recipient hasn't unsubscribed, but doesn't have a valid email address", func() {
			Context("when the recipient has no emails", func() {
				BeforeEach(func() {
					delivery.Email = ""
					userLoader.LoadCall.Returns.Users = map[string]uaa.User{
						"user-123": {},
					}
					j := gobble.NewJob(delivery)
					job = &j

					v1Process.Deliver(job, logger)
				})

				It("logs the info", func() {
					lines, err := parseLogLines(buffer.Bytes())
					Expect(err).NotTo(HaveOccurred())

					Expect(lines).To(ContainElement(logLine{
						Source:   "notifications",