Write simple rspec tests on one line for fun and profit

If you have a test set up that performs one assertion then you can condense your test into one line, this makes things way more readable and shortens your tests.

For example:

it "should return a response header with JSON in it" do
  response.header['Content-Type'].should include 'json'

Can become:

it { response.header['Content-Type'].should include 'json' }

When you have lots of small tests like this it really helps to make your tests easier to read, which will in turn help you in keeping them up to date and sharing them with other people.

Recent posts View all

Talk CSS

FrontEnders - Web Performance

Sharing some of my thoughts on a FrontEnders meetup on the topic of Web Performance


Tips for how to ask for time off to attend conferences

Asking for time off to attend a conference can be nerve-racking, these tips will get you closer to attending the conferences you're interested in.