Search the web
Sign In
New User? Sign Up
TestFirstUserInterfaces
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
custom, nested HTML matchers in RSpec   Message List  
Reply | Forward Message #1036 of 1051 |
Zach Dennis wrote:

>> response.body.should be_xml_with do
>> form :action => '/users' do
>> fieldset do
>> legend "Personal Information"
>> label "First name"
>> input :type => 'text', :name => 'user[first_name]'
>> end
>> end
>> end

> I like this a lot.

Boom: http://gist.github.com/76136

it 'should have a form with a fieldset' do
render '/users/new'

response.body.should be_html_with{
form :action => '/users' do
fieldset do
legend 'Personal Information'
label 'First name'
input :type => 'text', :name => 'user[first_name]'
end
end
}
end

I think I never got around to writing that because I just always assumed someone
already had. I have to watch that about myself!

Only one feature is missing: At fault time, the matcher naturally prints out a
diagnostic containing two snips of HTML - the specification's reference, and
your page's sample. (Both, of course, are restricted to the fault's context -
not the whole page.) But...

The samples are not indented! The specification's reference is all run together,
and your page's sample is (unfortunately!) exactly the way your View system
generated it. I have a question out to Nokogiri about this...

--
Phlip
http://www.zeroplayer.com/



Mon Mar 9, 2009 6:59 am

phlipcpp
Offline Offline
Send Email Send Email

Forward
Message #1036 of 1051 |
Expand Messages Author Sort by Date

... Boom: http://gist.github.com/76136 it 'should have a form with a fieldset' do render '/users/new' response.body.should be_html_with{ form :action =>...
Phlip
phlipcpp
Offline Send Email
Mar 9, 2009
6:59 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help