seems like it'd make sense to just add this to http://code.google.com/ p/rspec-on-rails-matchers/

linoj

On Mar 14, 2008, at 8:48 AM, Brandon Keepers wrote:

Zach,

On 3/14/08, Zach Moazeni <[EMAIL PROTECTED]> wrote:
This hints at another extension I've wanted to write for us for a while.

Common html selector strings, Labels, input fields, textareas, forms, links, etc

Really just rolling up something like:

response.should have_tag("input[type=text][name=?][value=?] [id=company-name]", "user[company_name]", "Some Company Inc.")

into something like:

respose.should have_text_input(:user, :company_name, :id => "company-name", "Some Company Inc.")

It feels closer to the Rails view helpers. Not a huge win, but we have so many selectors than abstracting up one would make our specs more readable.


I've been thinking about doing the same thing. I want matchers like have_text_input and have_text_input_with_label.

I think I'll write them for my next project, and then extract them if they're useful.

brandon

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to