Blog

  • RSpec FAIL – Testing Rails ‘destroy’

    I’m writing some specs for Citrulu and was scratching my head about this one for a while: When writing specs for Controllers, some http methods accept a hash as an input: it “assigns the requested test_file as @test_file” do controller.stub(:check_ownership!) get :edit, {:id => @test_file.to_param} assigns(:test_file).should eq(@test_file) end However with delete, this doesn’t work – the following…

  • Caching with Varnish on Heroku (Rails)

    I had some trouble with a personal Rails project – trying to get it to use Varnish caching. I’ve collected my learnings on my personal blog.

  • Permanent fix for Rails’ wretched deprecation warning

    Developing rails apps under Ubuntu means that we get a lot of these warnings: DEPRECATION WARNING: require “activerecord” is deprecated and will be removed in Rails 3. Use require “active_record” instead. (called from at /usr/lib/ruby/vendor_ruby/activerecord.rb:2) Recently, we added a cron job to an app which meant that we were getting emailed this error every hour,…

  • Disable your caps lock in Ubuntu

    I hate the caps lock: it seems to exist just to give me strings of shouty text and to confuse vim. Normally, I just pop it off my keyboard. But I just got a nice new Das Keyboard professional, and I didn’t want to mutilate it. I had a quick Google and found lots of…

  • Barclays Bikes gem

    Harry Marr (GoCardless) has made barclays_bikes: a cool little gem that scrapes the Barclays Cycle Hire website and gives you a command line interface to get the number of bikes and free spaces available at each docking station. For example, $ bbikes Gives the full list of London’s docking stations and $ bbikes Borough Gives you…

  • How Alphagov might change UK government for the better

    Alphagov. It’s here, it’s great, and if it’s taken forward, it will herald a great deal of positive change. Not just on the web, but in the way that government does things – and that will bring harder challenges. There’s lots in Alphagov to be pleased about. It’s not perfect, but as an attempt to…