Skip to content
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

Observers not firing in feature/integration tests using Capybara #44

Open
gregblass opened this issue Mar 14, 2016 · 2 comments
Open

Observers not firing in feature/integration tests using Capybara #44

gregblass opened this issue Mar 14, 2016 · 2 comments

Comments

@gregblass
Copy link

I'm using Capybara for integration testing. My observers work fine in my app and in my regular tests, but Capybara feature tests do not trigger any observers no matter what I try. Has anyone dealt with this or is this a known or intentional behavior?

I'm using the latest version of RSpec, Capybara (github masters) and Rails 5.0.0beta3.

@gregblass
Copy link
Author

gregblass commented Apr 23, 2016

Ended up completely refactoring my entire app away from observers, days of work, just because I could not find a way around this. In some cases it actually made my code better because I was able to abstract it even further into concerns, but in other cases I still believe that observers make for better software engineering than model callbacks. I was sad to have to do it for those cases.

It seems that once observers were dropped from the core of Rails that the community has pretty much abandoned them - so I was forced to do so as well.

@mikecmpbll
Copy link

i'm experiencing this as well, since upgrading from rails 4.2 to 5.1. however, for me it's only intermittent. i'm updating the model in the test suite's setup; sometimes the observer fires and sometimes it doesn't (consistent amongst a single run of the suite though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants