You are currently browsing the tag archive for the 'cucumber' tag.

Sometimes distributed team project management is very trying.

  • See Rails request paths in ‘top’ - A nice idea from Dave Thomas. I wonder if this should make its way into core.
  • TextMate Productivity Tips - From 456 Berea St. Tips are always fun.
  • cuc-demo - A demonstration of BDD with cucumber in the form of a tagged git repository.
  • Ruby 1.9.1 Preview 2 - It’s getting closer.
  • Why Git is Better than X - Just in case you want reasons to switch.
  • I was complaining a few days ago that I was having trouble with authentication in cucumber stories in conjunction with RSpec. It turned out I was making a very stupid mistake (”administrator” and “admin” are not, in fact, the same thing). But in the interests of helping out anyone who ends up here via search engine, here’s how I’ve got it sorted out for now.

    Here’s one of our current cucumber scenarios:

    
      Scenario: See all vendors
    	Given I am logged in as a user in the administrator role
    	And There are 3 vendors
    	When I go to the manage vendors page
    	Then I should see the first 3 vendor names
    

    And here’s the corresponding part of the step file that handles the login:

    
    Given /i am logged in as a user in the (.*) role/i do |role|
      @user = Factory.create(:user, :name => "the user",
        :login => "the_login",
        :password => "password",
        :password_confirmation => "password")
      @role = Factory.create(:role, :rolename => role)
      @user.roles << @role
      visits "/login"
      fills_in("login", :with => "the_login")
      fills_in("password", :with => "password")
      clicks_button("Log in")
    end
    

    Note that I’m using Factory Girl to instantiate objects in this application’s tests.

    There may be a better pattern for this - I’m just getting started with cucumber. But for now, it works for me.

    My latest work in progress: The Rails Initialization Process.

    Anyone had to manage cucumber/webrat stories that include logging on to a session via restful authentication? How’d you do it?

    Yesterday’s fun was getting started with cucumber, as some of the links below will tell you.

    Early mornings are the most peaceful time around here. Which may explain why I’m awake at 4AM.

    • CouchDB with Rails - The latest screencast from PeepCode. CouchDB has been on my radar for a long time but I haven’t had a good excuse to use it yet.
    • Reminder Tests - Dan Manges suggest some novel uses for automated tests. Well, novel to me, anyhow.
    • Cucumber - Plain-text BDD tool that’s an alternative to RSpec stories.
    • turled - The “look up Twitter users’ web sites fast” script has turned into a whole site, complete with my Ubiquity command.