Don't miss

I created an open source development tool to quickly & dynamically mock API endpoints. Check it out at GitHub: DuckRails

Heads up

I will no longer maintain arubystory. For new posts, find me at my personal blog. CU there!

Tuesday, October 28, 2014

Testing execution of a before_filter with RSpec custom matcher

UPDATE: I created my first gem to cover the functionality of this post. Visit its homepage here.

I was working on my application and I wanted to write some RSpec tests for some controllers having before_filter for some actions. I didn't want to explicitly test the behaviour of the filter since it was already tested in another context. I only wanted to test that it is being executed.

Tuesday, October 14, 2014

Rails - Rescue from memory leak

Lately, I've been trying to find possible memory leaks in a rails 3.2.x application.




NOT easy, believe me...

Anyway, after visiting almost every single result from googling "rails memory leak", I learned something I didn't know. Symbols in ruby never die.

Given that, I wrote some code to track the creation of symbols in the application by rendering a debugging kind of panel at the bottom of my application's layout which kept the previously generated symbols in an array and in each request, if new symbols where created, they were rendered as strings.