Code Monkey home page Code Monkey logo

action_mailbox_amazon_ingress's Introduction

ActionMailboxAmazonIngress

Provides Amazon SES/SNS integration with Rails ActionMailbox.

Installation

Add this line to your application's Gemfile:

gem 'action_mailbox_amazon_ingress', '~> 0.1.3'

Configuration

Amazon SES/SNS

  1. Configure SES to (save emails to S3)(https://docs.aws.amazon.com/ses/latest/dg/receiving-email-action-s3.html) or to send them as raw messages.

  2. Configure the SNS topic for SES or for the S3 action to send notifications to +/rails/action_mailbox/amazon/inbound_emails+. For example, if your website is hosted at https://www.example.com then configure SNS to publish the SES notification topic to this HTTP endpoint: https://example.com/rails/action_mailbox/amazon/inbound_emails

Rails

  1. Configure ActionMailbox to accept emails from Amazon SES:
# config/environments/production.rb
config.action_mailbox.ingress = :amazon
  1. Configure which SNS topics will be accepted:
# config/environments/production.rb
config.action_mailbox.amazon.subscribed_topics = %w(
  arn:aws:sns:eu-west-1:123456789001:example-topic-1
  arn:aws:sns:us-east-1:123456789002:example-topic-2
)

SNS Subscriptions will now be auto-confirmed and messages will be automatically handled via ActionMailbox.

Note that even if you manually confirm subscriptions you will still need to provide a list of subscribed topics; messages from unrecognized topics will be ignored.

See ActionMailbox documentation for full usage information.

Testing

RSpec

Two RSpec request spec helpers are provided to facilitate testing Amazon SNS/SES notifications in your application:

  • amazon_ingress_deliver_subscription_confirmation
  • amazon_ingress_deliver_email

Include the ActionMailboxAmazonIngress::RSpec extension in your tests:

# spec/rails_helper.rb

require 'action_mailbox_amazon_ingress/rspec'

RSpec.configure do |config|
  config.include ActionMailboxAmazonIngress::RSpec
end

Configure your test environment to accept the default topic used by the provided helpers:

# config/environments/test.rb

config.action_mailbox.amazon.subscribed_topics = ['topic:arn:default']

Example Usage

# spec/requests/amazon_emails_spec.rb

RSpec.describe 'amazon emails', type: :request do
  it 'delivers a subscription notification' do
    amazon_ingress_deliver_subscription_confirmation
    expect(response).to have_http_status :ok
  end

  it 'delivers an email notification' do
    amazon_ingress_deliver_email(mail: Mail.new(to: '[email protected]'))
    expect(ActionMailbox::InboundEmail.last.mail.recipients).to eql ['[email protected]']
  end
end

You may also pass the following keyword arguments to both helpers:

  • topic: The SNS topic used for each notification (default: topic:arn:default).
  • authentic: The Aws::SNS::MessageVerifier class is stubbed by these helpers; set authentic to true or false to define how it will verify incoming notifications (default: true).

Development

Setup

bin/setup

Testing

Ensure Rubocop, RSpec, and StrongVersions compliance by running make:

make

Updating AWS Fixtures

bundle exec rake sign_aws_fixtures

Contributing

Pull requests are welcome.

License

The gem is available as open source under the terms of the MIT License.

action_mailbox_amazon_ingress's People

Contributors

bobf avatar dorianmariecom avatar seuros avatar ssunday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

action_mailbox_amazon_ingress's Issues

Rails 7?

Hello - first, this is a super gem, and I'll enjoy it once I get it working.

Is it Rail 7 compatible? I'm having issues getting it up and running, and I wonder if something has changed on SNS over the last couple of years...

  • In the SNS subscription, should I have raw message deliver enabled or disabled?

If I enable it, the create method in the inbound_emails_controller will fail when verifying the signature because the structure of the SNS notification doesn't include the Signature Version field, so the SNS MessageVerifier fails.

If I disable it, the create method works as advertised, but the process method in my mailbox class can't find any values like the recipients or the email body. I can get to the @incoming_email object within process(), but I don't see a way to get to the message body or addresses. e.g mail['from'] is nil. And I noticed that the gem can't find the message ID either and generates a new one: Message-ID couldn't be parsed or is missing. Generated a new Message-ID.

I suspect I'm missing something obvious...

403 Forbidden for ngrok endpoint

Thanks for maintaining this lib as I just need amazon ses for rails inbound emails and it's awesome that you support removed form rails action mailbox ses support.

But unfortunately, I have some troubles with setup ses + sns + action
mailbox. With ngrok I exposed public endpoint to my local machine but all requests to
POST /rails/action_mailbox/amazon/inbound_emails

Respond with:
403 Forbidden

Cors is * for all origins and request types.

Any suggestions? Maybe on resolving this task I can extend your README or write a blog post. Thanks

sync Rails PR with this repo?

Hi, I'm interested to sync this library with the Rails PR code, that it seems it has more changes

does it makes any sense to you ?
I don't know if the Rails PR will be merged soon so it might be a good idea, what you think ?

ActionMailbox::Router::RoutingError (ActionMailbox::Router::RoutingError)

First of all, thanks for your contribution with this gem, was a greate initiave after discontinuing native support.

So, after make all setup on AWS SES (Verifying domain and Email receive rule sets) and SNS (Creating topics and related subscriptions), I have experieced the following error.

The POST request is fired from AWS and the tables action_mailbox_inbound_emails, active_storage_blobs, active_storage_attachments are filled, but on performing ActionMailbox::RoutingJob the error occurs.

Can provide any help to solve this?

Error performing ActionMailbox::RoutingJob (Job ID: 25ce2a46-7fb7-4085-a492-27ff3b6be3d1) from Sidekiq(action_mailbox_routing) in 10.53ms: ActionMailbox::Router::RoutingError (ActionMailbox::Router::RoutingError):
/usr/local/bundle/ruby/2.6.0/gems/actionmailbox-6.0.2.1/lib/action_mailbox/router.rb:29:in `route'
/usr/local/bundle/ruby/2.6.0/gems/actionmailbox-6.0.2.1/lib/action_mailbox/routing.rb:18:in `route'
/usr/local/bundle/ruby/2.6.0/gems/actionmailbox-6.0.2.1/app/models/action_mailbox/inbound_email/routable.rb:22:in `route'
/usr/local/bundle/ruby/2.6.0/gems/actionmailbox-6.0.2.1/app/jobs/action_mailbox/routing_job.rb:10:in `perform'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/execution.rb:39:in `block in perform_now'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
/usr/local/bundle/ruby/2.6.0/gems/sentry-raven-2.13.0/lib/raven/integrations/rails/active_job.rb:13:in `block (2 levels) in included'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `instance_exec'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/usr/local/bundle/ruby/2.6.0/gems/i18n-1.7.1/lib/i18n.rb:313:in `with_locale'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `instance_exec'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/core_ext/time/zones.rb:66:in `use_zone'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/timezones.rb:9:in `block (2 levels) in <module:Timezones>'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `instance_exec'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/logging.rb:25:in `block (4 levels) in <module:Logging>'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/notifications.rb:180:in `block in instrument'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/notifications.rb:180:in `instrument'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/logging.rb:24:in `block (3 levels) in <module:Logging>'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/logging.rb:45:in `block in tag_logger'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/tagged_logging.rb:80:in `block in tagged'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/tagged_logging.rb:28:in `tagged'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/tagged_logging.rb:80:in `tagged'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/logging.rb:45:in `tag_logger'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/logging.rb:21:in `block (2 levels) in <module:Logging>'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `instance_exec'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:139:in `run_callbacks'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/execution.rb:38:in `perform_now'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/execution.rb:24:in `block in execute'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/railtie.rb:43:in `block (4 levels) in <class:Railtie>'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/execution_wrapper.rb:88:in `wrap'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/reloader.rb:72:in `block in wrap'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/execution_wrapper.rb:84:in `wrap'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/reloader.rb:71:in `wrap'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/railtie.rb:42:in `block (3 levels) in <class:Railtie>'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `instance_exec'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:139:in `run_callbacks'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/execution.rb:22:in `execute'
/usr/local/bundle/ruby/2.6.0/gems/activejob-6.0.2.1/lib/active_job/queue_adapters/sidekiq_adapter.rb:42:in `perform'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:196:in `execute_job'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
/usr/local/bundle/ruby/2.6.0/gems/apartment-sidekiq-1.2.0/lib/apartment/sidekiq/middleware/server.rb:5:in `block in call'
/usr/local/bundle/ruby/2.6.0/bundler/gems/apartment-f266f73e5883/lib/apartment/adapters/abstract_adapter.rb:85:in `switch'
/usr/local/lib/ruby/2.6.0/forwardable.rb:230:in `switch'
/usr/local/bundle/ruby/2.6.0/gems/apartment-sidekiq-1.2.0/lib/apartment/sidekiq/middleware/server.rb:4:in `call'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
/usr/local/bundle/ruby/2.6.0/gems/sentry-raven-2.13.0/lib/raven/integrations/sidekiq.rb:9:in `call'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/middleware/chain.rb:143:in `invoke'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:163:in `block in process'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/job_retry.rb:111:in `local'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/rails.rb:43:in `block in call'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/execution_wrapper.rb:88:in `wrap'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/reloader.rb:72:in `block in wrap'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/execution_wrapper.rb:88:in `wrap'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-6.0.2.1/lib/active_support/reloader.rb:71:in `wrap'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/rails.rb:42:in `call'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:257:in `stats'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/job_logger.rb:13:in `call'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/job_retry.rb:78:in `global'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:124:in `block in dispatch'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/logger.rb:10:in `with'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/job_logger.rb:33:in `prepare'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:123:in `dispatch'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:162:in `process'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:78:in `process_one'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/processor.rb:68:in `run'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/util.rb:15:in `watchdog'
/usr/local/bundle/ruby/2.6.0/gems/sidekiq-6.0.4/lib/sidekiq/util.rb:24:in `block in safe_thread'
2020-07-21T22:24:28.056Z pid=1 tid=gqdwog9up class=ActionMailbox::RoutingJob jid=4b96377e50d4c752edaac288 elapsed=0.026 INFO: fail
2020-07-21T22:24:28.057Z pid=1 tid=gqdwog9up WARN: {"context":"Job raised exception","job":{"retry":true,"queue":"action_mailbox_routing","class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"ActionMailbox::RoutingJob","args":[{"job_class":"ActionMailbox::RoutingJob","job_id":"25ce2a46-7fb7-4085-a492-27ff3b6be3d1","provider_job_id":null,"queue_name":"action_mailbox_routing","priority":null,"arguments":[{"_aj_globalid":"gid://ping/ActionMailbox::InboundEmail/5"}],"executions":0,"exception_executions":{},"locale":"pt-BR","timezone":"Brasilia","enqueued_at":"2020-07-21T22:24:01Z"}],"jid":"4b96377e50d4c752edaac288","created_at":1595370241.1979206,"apartment":"public","enqueued_at":1595370268.0300646,"error_message":"ActionMailbox::Router::RoutingError","error_class":"ActionMailbox::Router::RoutingError","failed_at":1595370241.3972886,"retry_count":0},"jobstr":"{\"retry\":true,\"queue\":\"action_mailbox_routing\",\"class\":\"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper\",\"wrapped\":\"ActionMailbox::RoutingJob\",\"args\":[{\"job_class\":\"ActionMailbox::RoutingJob\",\"job_id\":\"25ce2a46-7fb7-4085-a492-27ff3b6be3d1\",\"provider_job_id\":null,\"queue_name\":\"action_mailbox_routing\",\"priority\":null,\"arguments\":[{\"_aj_globalid\":\"gid://ping/ActionMailbox::InboundEmail/5\"}],\"executions\":0,\"exception_executions\":{},\"locale\":\"pt-BR\",\"timezone\":\"Brasilia\",\"enqueued_at\":\"2020-07-21T22:24:01Z\"}],\"jid\":\"4b96377e50d4c752edaac288\",\"created_at\":1595370241.1979206,\"apartment\":\"public\",\"enqueued_at\":1595370268.0300646,\"error_message\":\"ActionMailbox::Router::RoutingError\",\"error_class\":\"ActionMailbox::Router::RoutingError\",\"failed_at\":1595370241.3972886,\"retry_count\":0}"}

Possible changes upstream in SES

Howdy, thanks for putting this gem together! I was grateful to find it when I realized SES had been pulled from Rails core.

I know you're working on getting this merged upstream, but just in case this can save you some headache down the road I wanted to let you know about something I ran into today.

When I am receiving the SNS notification the mail message is stored at message['mail'] and not message['content']
Maybe there's a configuration I missed when setting it up? Seems like AWS shouldn't be changing these keys willy nilly.

Action Mailbox mistakes attachment as body if no body exists

I created issue 50755 on the Rails project, which relates to an issue whereby Action Mailbox does not parse an attachment if the email has no body.

There has been a suggestion on the issue that this relates to an incompatibility with emails from SES. If this is true, I would be happy to work on the problem, but I'd like to verify that it is an SES-specific issue, and not an issue that could occur with other providers (and therefore should be fixded in Rails)

rails 6.1 / ruby 2.7.2

Hi , I've tried to run the gem specs and specs fails

➜  action_mailbox_amazon_ingress git:(master) ✗ bundle exec rspec
== 20200508151055 CreateActiveStorageTables: migrating ========================
-- create_table(:active_storage_blobs, {})
   -> 0.0014s
-- create_table(:active_storage_attachments, {})
   -> 0.0011s
== 20200508151055 CreateActiveStorageTables: migrated (0.0026s) ===============

== 20200508151056 CreateActionMailboxTables: migrating ========================
-- create_table(:action_mailbox_inbound_emails, {})
   -> 0.0018s
== 20200508151056 CreateActionMailboxTables: migrated (0.0019s) ===============


ActionMailboxAmazonIngress::RSpec::Email
  is expected to be a kind of ActionMailboxAmazonIngress::RSpec::Email
  url
    is expected to eql "/rails/action_mailbox/amazon/inbound_emails"
  headers
    is expected to eql {"content-type"=>"application/json"}
  params
    is expected to eql {"Message"=>"{\"notificationType\":\"Received\",\"content\":\"raw encoded email\"}", "TopicArn"=>"topic:arn:default", "Type"=>"Notification"}
  not authentic
    authentic?
      is expected to eql false
  authentic
    authentic?
      is expected to eql true
  custom topic
    params
      is expected to include {"TopicArn" => "custom-topic"}

ActionMailboxAmazonIngress::RSpec::SubscriptionConfirmation
  is expected to be a kind of ActionMailboxAmazonIngress::RSpec::SubscriptionConfirmation
  url
    is expected to eql "/rails/action_mailbox/amazon/inbound_emails"
  headers
    is expected to eql {"content-type"=>"application/json"}
  params
    is expected to eql {"SubscribeURL"=>"http://example.com/subscribe", "TopicArn"=>"topic:arn:default", "Type"=>"SubscriptionConfirmation"}
  not authentic
    authentic?
      is expected to eql false
  authentic
    authentic?
      is expected to eql true
  custom topic
    params
      is expected to include {"TopicArn" => "custom-topic"}

ActionMailboxAmazonIngress
  has a version number

inbound email
  receives inbound email (FAILED - 1)

rspec
  topic subscription
    recognized topic
      renders 200 OK
    unrecognized topic
      renders 401 Unauthorized
  email delivery
    recognized topic
      renders 204 No Content (FAILED - 2)
      delivers an email to inbox (FAILED - 3)
    unrecognized topic
      renders 401 Unauthorized

subscription confirmation
  valid Amazon SSL signature
    fetches subscription URL
  invalid Amazon SSL signature
    does not fetch subscription URL
  unrecognized topic
    does not fetch subscription URL
  recognized topic
    fetches subscription URL

Failures:

  1) inbound email receives inbound email
     Failure/Error: expect(ActionMailbox::InboundEmail.count).to eql 1
     
       expected: 1
            got: 0
     
       (compared using eql?)
     # ./spec/requests/inbound_email_spec.rb:13:in `block (2 levels) in <top (required)>'
     # /Users/michelson/.rvm/gems/ruby-2.7.1/gems/webmock-3.12.2/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

  2) rspec email delivery recognized topic renders 204 No Content
     Failure/Error: expect(response).to have_http_status :no_content
       expected the response to have status code :no_content (204) but it was :internal_server_error (500)
     # ./spec/requests/rspec_spec.rb:33:in `block (4 levels) in <top (required)>'
     # /Users/michelson/.rvm/gems/ruby-2.7.1/gems/webmock-3.12.2/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

  3) rspec email delivery recognized topic delivers an email to inbox
     Failure/Error: expect(ActionMailbox::InboundEmail.last.mail.recipients).to eql ['[email protected]']
     
     NoMethodError:
       undefined method `mail' for nil:NilClass
     # ./spec/requests/rspec_spec.rb:38:in `block (4 levels) in <top (required)>'
     # /Users/michelson/.rvm/gems/ruby-2.7.1/gems/webmock-3.12.2/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

Finished in 0.28573 seconds (files took 3.9 seconds to load)
25 examples, 3 failures

Failed examples:

rspec ./spec/requests/inbound_email_spec.rb:10 # inbound email receives inbound email
rspec ./spec/requests/rspec_spec.rb:31 # rspec email delivery recognized topic renders 204 No Content
rspec ./spec/requests/rspec_spec.rb:36 # rspec email delivery recognized topic delivers an email to inbox

➜  action_mailbox_amazon_ingress git:(master) ✗ 

my diff:

diff --git a/.ruby-version b/.ruby-version
index aedc15b..37c2961 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-2.5.3
+2.7.2
diff --git a/action_mailbox_amazon_ingress.gemspec b/action_mailbox_amazon_ingress.gemspec
index 1e2dc85..236b387 100644
--- a/action_mailbox_amazon_ingress.gemspec
+++ b/action_mailbox_amazon_ingress.gemspec
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
   spec.require_paths = ['lib']
 
   spec.add_runtime_dependency 'aws-sdk-sns', '~> 1.23'
-  spec.add_dependency 'rails', '~> 6.0'
+  spec.add_dependency 'rails', '~> 6.1'
 
   spec.add_development_dependency 'betterp', '~> 0.1.3'
   spec.add_development_dependency 'devpack', '~> 0.2.1'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.