28 Nov '14, 10pm

How to Fix Circular Dependency Errors in Rails Integration Tests

We recently joined an existing Rails 4.1 project that uses AngularJS. We observed sporadic Capybara::ElementNotFound failures in RSpec feature specs with JavaScript. These failures were false positives and undermined our confidence in the test suite, preventing us from using a fluid outside-in testing process. Finding the Problem We saw in Capybara screenshots that the pages (rendered with AngularJS) were failing to fully load, but only in tests. In order to learn more, we reviewed test.log , and saw this error: RuntimeError (Circular dependency detected while autoloading constant MyClass) This looked like a race condition while loading files. Lazily loading files is not threadsafe in Ruby , and since Webrick is multithreaded and Rails.configuration.eager_loading is disabled by default in test, we suspected that concurrency was enabled. In production environments, Rails 4....

Full article: http://robots.thoughtbot.com/how-to-fix-circular-dependen...

Tweets

Russian Navy successfully tests new missile

Russian Navy successfully tests new missile

stripes.com 28 Nov '14, 6pm

Russian President Vladimir Putin, right, meets with senior military officers on Oct. 31, 2014, in Moscow, where he said th...

Curious about what the 21 Day Fix Meal Plan looks like? Check out this for more information > #21dayfix

Curious about what the 21 Day Fix Meal Plan loo...

runningrachel.com 29 Nov '14, 5pm

I am starting the 21 Day Fix this week. This is forcing me to really plan my meals for the day and week. I usually plan di...

:remote => true in #Rails Forms via @korenlc #R...

korenlc.com 02 Dec '14, 5am

to your form submits the data to your database without refreshing the page. However, this information will not automatical...