thanks for sharing your examples. I was just thinking about posting
something that can be introduced nicely with your sample app.
Now in cuc_demo we’ve got a step definition for /^there are no posties$/
in postie_steps.rb. This way, if we’d need to add a “Given there are no
users” step we should create a user_steps.rb with a similar definition.
IMHO it would be nice to have instead a “context_definitions.rb” with
common “givens” (similar to navigation_definitions.rb) and there a more
general definition, like for instance:
Given /^there are no (.*)$/ do |thing| thing_to_model(thing).destroy_all
In our World we should have a thing_to_class method with the mappings
between the names used in features and the model class that implement
I think this mapping is also useful if tomorrow you and/or your client
decides to call it “pasties” instead of “posties” (and is more than
useful if you’re writing your features in other language than English,
cause you cannot obtain the class name through transformations of the
I’d really appreciate your feedback!
P.S. Sorry to the guys on IRC who got this message twice.
Fernando García Samblas
C/ Salamanca 17
+34 91 567 06 05