[rspec-users] Using Mechanize in Story Step Implementations

Andy Watts andywatts at yahoo.com
Wed Oct 24 09:56:52 EDT 2007


Hi,

Thought this might be of interest story writers.
The mechanize plugin seems to play nice with RSpec.
The following mix of methods seems to work just fine.
I especially like the helpers for populating forms.

agent = WWW::Mechanize.new
page = agent.get 'http://www.gmail.com'
page.should have_tag('form', :count => 1)
form = page.forms.first
form.email = 'd at d.com'
page = agent.submit form

Could make for some nice step implementations.
Almost seems too easy, is there anything that mechanize will break?

- Andy
-- 
View this message in context: http://www.nabble.com/Using-Mechanize-in-Story-Step-Implementations-tf4683999.html#a13384581
Sent from the rspec-users mailing list archive at Nabble.com.



More information about the rspec-users mailing list