-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email_spec causes rspec to fail (though not under Spring) #187
Comments
@davidham I'm also seeing this under Rails 5 - did you have any luck solving this? |
@michaelrshannon I'm afraid not, after trying many different things I had to uninstall it. I'm having a hard time with my email-related integration tests generally. I have a feature spec that is supposed to verify (among other things) that an email was sent, but the spec fails intermittently. |
@davidham @michaelrshannon Here's the fix. I was running into the same problem and finally traced it down. In your require 'spec_helper'
require File.expand_path('../../config/environment', __FILE__) to this: require File.expand_path('../../config/environment', __FILE__)
require 'spec_helper' It's safe to do this, and in fact this is how RSpec generates the |
@sergiopantoja This is awesome, thanks for posting this! I wanted to use email-spec and I still have it commented out in my Gemfile, but I'll definitely give this a try. |
👍 I am still getting this error with the proposed fix above in Rails 5.0.0 |
Loading email-spec before config/environment was causing rspec to fail email-spec/email-spec#187
I installed email_spec per the instructions, but when I run rspec it fails with the following message:
This is from my
spec_helper.rb
:When I comment out the email_spec lines, Rspec runs again.
Strange thing though: when I run Rspec under Spring with
bin/rspec
, I don't see this issue. Any ideas why?The text was updated successfully, but these errors were encountered: