Sha256: a83bca1d05a7c64dfcd95f6ef006c53177a4590c7f853680db17c6c9b8d4749e
Contents?: true
Size: 1.77 KB
Versions: 4
Compression:
Stored size: 1.77 KB
Contents
Feature: Sending email As a Chatterbox user I want to send emails using the same options as any other service So that I can deliver notifications over email Scenario: Simple email sending Given a file named "simple_email_sending.rb" with: """ require "chatterbox" require "chatterbox/services/email" ActionMailer::Base.delivery_method = :test Chatterbox::Publishers.register do |notice| Chatterbox::Services::Email.deliver(notice) end Chatterbox.notify :summary => "subject", :body => "body", :config => { :to => "joe@example.com", :from => "sender@example.com" } puts ActionMailer::Base.deliveries.last.encoded """ When I run "simple_email_sending.rb" Then the exit code should be 0 And the stdout should match "To: joe@example.com" @wip Scenario: Sending with default configuration Given a file named "default_configuration_email_send.rb" with: """ require "chatterbox" require "chatterbox/services/email" ActionMailer::Base.delivery_method = :test Chatterbox::Publishers.register do |notice| Chatterbox::Services::Email.deliver(notice) end Chatterbox::Services::Email.configure({ :to => "to@example.com", :from => "from@example.com", :summary_prefix => "[CUKE] " }) Chatterbox.notify :summary => "subject goes here!", :body => "body", :config => { :to => "override@example.com" } puts ActionMailer::Base.deliveries.last.encoded """ When I run "default_configuration_email_send.rb" Then the exit code should be 0 And the stdout should match "To: override@example.com" And the stdout should match "From: from@example.com" And the stdout should match "Subject: [CUKE] subject goes here!"
Version data entries
4 entries across 4 versions & 1 rubygems