For my RSS feed subscribers and anyone else who is interested, I’ve relocated my technology blogging to Agile Reasoning.
Thanks!
For my RSS feed subscribers and anyone else who is interested, I’ve relocated my technology blogging to Agile Reasoning.
Thanks!
I’ve been using Cucumber and Webrat for only a couple months now. Today I needed something new and it wasn’t obvious how to make it work.
Here’s an example of a test in Cucumber:
Given I am Sam When I follow "Foo" Then the "Bar" field should contain "Baz"
Which relies on Webrat:
Then /^the "([^"]*)" field should contain "([^"]*)"$/ do |field, value|
field_labeled(field).value.should =~ /#{value}/
end
But what if it’s not a text field? What if it’s a select? Then we need to check which value is selected.
Given Sam I am When I follow "Foo" Then "Baz" should be selected for "Bar"
Here’s my solution:
Then /^"([^"]*)" should be selected for "([^"]*)"$/ do |value, field|
field_labeled(field).element.search(".//option[@selected = 'selected']").inner_html.should =~ /#{value}/
end
Hope this helps!
First, install these packages using apt-get or aptitude:
How do you use your Windshield Time? You know, the time you spend alone in your car. Many use it to listen to music or talk radio. Others may catch up on phone calls or, faith defend us, email and text messages! If you tell me you don’t use it, you’re wrong. Even using it to contemplate is using the time, and you have consciously or unconsciously chosen to use it in that particular way. But maybe that’s not the real question. Meander with me for a bit…
If you’re confused about Eva Longoria of Desperate Housewives vs. Evan Longoria of the Tampa Bay Rays, I say it doesn’t matter. They’re both winners… they just play for different teams. ;-)
In one of my Ruby on Rails projects, I have a model validation which is dependent on attributes from a belongs_to parent. Normally, you can refer to a parent model as child.parent and access the parent’s attributes as child.parent.attr. The difficulty arises when the parent object is unsaved. Let’s look at the code:
If you’re like me, you’d like to know whether anyone is paying attention to what you have to say online. There are plugins for WordPress that will make this information available through the wp-admin pages. There are also tools such as AWStats that your hosting provider can likely provide. If you’ve outgrown those options, you may get what you need from Google Analytics. Whether you need it or just want it because you can, here are the basic steps:
Well, here it is my blog is only a week old and I’m already switching to a different engine on the back end. As I find my way around WordPress I’ll get the old content moved over.
My primary reason for moving is the apparent lack of full support for trackback in Typo.
So I was rolling through a 25MPH School Zone yesterday at 35MPH. I know, I’m bad, I should be punished. ;-) Then why the hell was the Washington Township school bus passing me!
Apparently, Madonna, Justin Timberlake, and Timbaland originally had 5 minutes to save the world. Until, that is, Warner Bros insisted on a 20% across the board cost reduction.