Search code examples
ruby-on-railsruby-on-rails-4rspecdevisecapybara

RSpec feature test for inherited Devise Registrations Controller - "Errno::EADDRNOTAVAIL: Cant assign requested address"


I have a Rails 4.2 app using Devise. I had to customize the Registrations controller in #create, and whenever I run my feature specs, I keep getting the error:

Errno::EADDRNOTAVAIL: Cant assign requested address - connect(2) for nil port 0

enter image description here

I'm out of ideas. What's going on? All my devise controller specs work fine, testing manually works fine, but what configuration remains?

My feature spec: /spec/features/visitor/visitor_can_signup_spec.rb

enter image description here


Solution

  • Turns out i had my config/environments/test.rb had the wrong mailer setting.

    I had

    config.action_mailer.delivery_method = :smtp
    

    so i changed it to:

    config.action_mailer.delivery_method = :test