Twitter Weekly Updates for 2010-07-25

Powered by Twitter Tools

Posted in Uncategorized | Leave a comment

Twitter Weekly Updates for 2010-07-18

Powered by Twitter Tools

Posted in Uncategorized | Leave a comment

The Simplest Possible Cucumber Test

I’m not really that good at testing. So what, so are a lot of people. Having some tests is better than none! And, the way testing tutorials are written can seem really complex and scary. Today I started thinking about the simplest possible way to get started with web app testing.

When I’m getting back into a project after not working on it for a while, I just want to know whether the application works. I want to know whether it will run on my development environment, even if I’m on a new machine. I have three computers that I use at various locations so this is important to me.

So for me the simplest possible test would be:

  • The home page should load. That is the default route should return a successful page without any errors. It will have some key piece of text that says it’s working.

Here’s how I do it with cucumber:

If you haven’t installed the cucumber gems yet, put this in your config/test.rbfile.

If you haven’t cucumber set up yet, run

script/generate cucumber

Then, create the file below:

File: features/homepage.feature

Feature: View homepage for app
  In order to make sure the app loads
  As a user
  I want to see the home page

Scenario: Homepage should say Search
  When I go to the homepage
  Then I should see "Search"

Tip: none of what you write in the Feature section really matters. It’s just for you or your client’s benefit.

Then, run

cucumber features

You should get the following output:

:> cucumber features
Feature: View homepage for app
  In order to make sure the app loads
  As a user
  I want to see the home page

  Scenario: Homepage should say Search # features/homepage.feature:6
    When I go to the homepage          # features/step_definitions/webrat_steps.rb:10
    Then I should see "My Telltale Text" # features/step_definitions/webrat_steps.rb:118

1 scenario (1 passed)
2 steps (2 passed)

Some cool things about this: “the homepage” is something that cucumber / webrat understands out of the box. See features/step_definitions/webrat_steps.rb for how to define other custom route names. And also, “I should see “something in quotes” is out of the box cucumber goodness.

Posted in Technology, Web Design, rubyonrails | Tagged , , , , , , , | Leave a comment

Real Direct Democracy

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty, and the pursuit of Happiness. That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed.

Not all corporations are created equal, as our conservative supreme court seems to think. It’s time to use our people power to set that straight. And, while we’re at it, let’s set up a direct democracy party too! The Australians have already made a first step!

Posted in Technology | Tagged , | Leave a comment

Twitter Weekly Updates for 2010-07-04

Powered by Twitter Tools

Posted in Uncategorized | Leave a comment

Twitter Weekly Updates for 2010-06-27

  • I'm at Seattle-Tacoma International Airport (SEA) ✈ (17801 International Blvd, SeaTac) w/ 35 others. http://4sq.com/2q9cxD #
  • Happy Summer Solstice & longest day! Seattle nautical twilight dusk ends at 10:48pm. Also means Ian might be up at 4:30, he prefers civil. #

Powered by Twitter Tools

Posted in Uncategorized | Leave a comment

Twitter Weekly Updates for 2010-06-20

Powered by Twitter Tools

Posted in Uncategorized | Leave a comment

Twitter Weekly Updates for 2010-06-13

  • Watch out for shady sites using #flash another zero day exploit in wild and Adobe has not patched Flash yet: http://bit.ly/flashbad #
  • Seattle.rb although I'll be playing with Safari 5 extensions – maybe I should be at NSCoder instead? (@ Espresso Vivace at The Brix) #
  • Created my first Safari extension, a toolbar for SustainableWebsites.com customers.Testers with Safari 5 needed http://bit.ly/aCZAKz #
  • @cbrumelle Congrats on the job at Twitter! I guess this means I have to get my butt to Vancouver before you move back to SF in reply to cbrumelle #
  • @sicarter where are you going to watch on Saturday? in reply to sicarter #

Powered by Twitter Tools

Posted in Uncategorized | Leave a comment

Twitter Weekly Updates for 2010-06-06

Powered by Twitter Tools

Posted in Uncategorized | Leave a comment

Twitter Weekly Updates for 2010-05-30

Powered by Twitter Tools

Posted in Uncategorized | Leave a comment