Testing Rails Engines With Rspec
After my lightning talk at Ruby North East, a couple of people asked me how to go about getting set up with an engine with RSpec as the testing framework. We’ve automated this at Sage, but here’s what’s necessary.
After my lightning talk at Ruby North East, a couple of people asked me how to go about getting set up with an engine with RSpec as the testing framework. We’ve automated this at Sage, but here’s what’s necessary.
I was recently a victim of the timthumb vulnerability. At first I noticed some rogue PHP in all my index.php files, which I cleaned up. But it turned out they had already got in enough to re-hack in no time at all. This time it was my javascript files which all had some obstruficated code in them, causing every page load to make a request to some random site.
In previous versions of rails, you could do MyController.filter_chain to get an object representing the filters on a controller.
Who wants to type “bundle install” all the time? Not me, that’s who!
After an evening of getting knee deep in the Rails core debugging and issue with counter_cache on a has_many :through, it seems this has been reported on lighthouse, and a fix has been applied in edge.
Here’s another little trick in CakePHP — it’s quite often that someone will request a big old list of paginated data, along with filters on that data.
Nothing to see here, just an aid to memory:
As much as MVC is great, sometimes there’s that little requirement that forces you to go against the standard way of doing things.
There seem to be two conventions for binding energy, one treating it as the (negative) potential energy due to the nucleons being close together, the other treating it as the (positive) energy needed to separate the nucleons.