You are currently browsing the tag archive for the 'cucumber' tag.
Sometimes distributed team project management is very trying.
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.
- Custom Tags in Liquid - A useful tutorial for an area where there isn’t much available.
- cucumber-tmbundle - Another TextMate bundle for cucumber.
- rspec 1.1.8 - A quick revision of 1.1.5, which was just released.
- default_value_for Rails plugin: declaratively define default values for ActiveRecord models - A plugin from Phusion.
Anyone had to manage cucumber/webrat stories that include logging on to a session via restful authentication? How’d you do it?
- rspec plain text stories + webrat = chunky bacon - I’m scouring the net to figure out best practices for cucumber stories; there’s not much out there. This was helpful.
- Easy PlainText Stories in Ruby on Rails Using WebRat - More work on smart stories.
- RubyGems How-To: Preventing Catastrophe - Some notes on versioning.
Yesterday’s fun was getting started with cucumber, as some of the links below will tell you.
- Thin 1.0 - Another project hits “release”.
- What ToDo - The next stop in my quest to find an OS X task manager that thinks the way I do.
- Cucumber for Ruby on Rails - Instructions on what to install to get started.
- WebRat - Non-browser tool for web page acceptance testing that works with Cucumber.
- Cucumber - Next Generation RSpec Story Runner - Some of the basics.
- TextMate Bundle for Cucumber and TextMate Bundle for Webrat - Useful adjuncts.
- Shoulda 2.0 - Big upgrade to one of the other BDD tools.
- Woulda - Plugin-specific tests for Shoulda. Can Coulda be far behind?
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.

