Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
Zach Dennis wrote: XPath is merely the mechanism in which you're allowed to find particular elements on a page. After typing: xpath :input, :name => "foo" xpath :input, :name => "bar" xpath :input, :name => "baz" I would probably write my own wrapper so I could omit the redundant "xpa

Re: [rspec-users] route_for

2009-03-08 Thread Yi
David, thanks very much Yi On Sun, Mar 8, 2009 at 10:45 PM, David Chelimsky wrote: > On Sun, Mar 8, 2009 at 10:21 PM, David Chelimsky > wrote: > > On Sun, Mar 8, 2009 at 10:15 PM, David Chelimsky > wrote: > >> On Sun, Mar 8, 2009 at 9:49 PM, Yi wrote: > >>> Get restful-authentication and rspe

Re: [rspec-users] route_for

2009-03-08 Thread David Chelimsky
On Sun, Mar 8, 2009 at 9:49 PM, Yi wrote: > Get restful-authentication and rspec trunk from github. And a couple tests > fail. One of them is this assertion: > > route_for(:controller => 'users', :action => 'destroy', :id => '1').should > == "/users/1" > > error msg is: > > should route users's 'd

Re: [rspec-users] route_for

2009-03-08 Thread David Chelimsky
On Sun, Mar 8, 2009 at 10:21 PM, David Chelimsky wrote: > On Sun, Mar 8, 2009 at 10:15 PM, David Chelimsky wrote: >> On Sun, Mar 8, 2009 at 9:49 PM, Yi wrote: >>> Get restful-authentication and rspec trunk from github. And a couple tests >>> fail. One of them is this assertion: >>> >>> route_for

Re: [rspec-users] route_for

2009-03-08 Thread David Chelimsky
On Sun, Mar 8, 2009 at 10:15 PM, David Chelimsky wrote: > On Sun, Mar 8, 2009 at 9:49 PM, Yi wrote: >> Get restful-authentication and rspec trunk from github. And a couple tests >> fail. One of them is this assertion: >> >> route_for(:controller => 'users', :action => 'destroy', :id => '1').shoul

[rspec-users] route_for

2009-03-08 Thread Yi
Get restful-authentication and rspec trunk from github. And a couple tests fail. One of them is this assertion: route_for(:controller => 'users', :action => 'destroy', :id => '1').should == "/users/1" error msg is: should route users's 'destroy' action correctly The recognized options <{"action

Re: [rspec-users] rspec, rspec-rails 1.1.99-12 and script/spec 'no such file to load -- spec'

2009-03-08 Thread Michael K
Hi David, Thanks for the quick reply, info, and patch. > > This fixed and pushed to github > > http://github.com/dchelimsky/rspec-rails/commit/cd15dd5cbd6ca9cf2cd2f... > > > > I've seen this with older versions of lib/tasks/rspec.rake that > > required 'spec'. Basically, when you run any rake ta

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
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. I just thought of about 3 truly sick ways

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Zach Dennis
On Sun, Mar 8, 2009 at 2:41 PM, Phlip wrote: > David Chelimsky wrote: > >>> xpath :'legend[ contains(., "Personal Information") ]' and >>> xpath :'label[ contains(., "First name") ]' and >>> xpath :input, :type => 'text', :name => 'user[first_name]' > >> This is nice, but t

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread David Chelimsky
On Sun, Mar 8, 2009 at 1:41 PM, Phlip wrote: > David Chelimsky wrote: > >>>         xpath :'legend[ contains(., "Personal Information") ]' and >>>         xpath :'label[ contains(., "First name") ]' and >>>         xpath :input, :type => 'text', :name => 'user[first_name]' > >> This is nice, but t

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
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. Then it should be ".should be_html_with"..

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
David Chelimsky wrote: xpath :'legend[ contains(., "Personal Information") ]' and xpath :'label[ contains(., "First name") ]' and xpath :input, :type => 'text', :name => 'user[first_name]' This is nice, but the abstractions are operating at different levels. The key

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Zach Dennis
On Sun, Mar 8, 2009 at 2:03 PM, David Chelimsky wrote: > On Sun, Mar 8, 2009 at 12:00 PM, Phlip wrote: >> RSpecsters: >> >> I like nested XPath expressions, because the outer XPath assertion can clip >> the diagnostic of the inner XPath assertion. You don't get the whole page >> spewed into your

Re: [rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread David Chelimsky
On Sun, Mar 8, 2009 at 12:00 PM, Phlip wrote: > RSpecsters: > > I like nested XPath expressions, because the outer XPath assertion can clip > the diagnostic of the inner XPath assertion. You don't get the whole page > spewed into your face when you fault! > > This specification, for example, tests

[rspec-users] response.body.should be_xml_with -- how to do nested xpath matches

2009-03-08 Thread Phlip
RSpecsters: I like nested XPath expressions, because the outer XPath assertion can clip the diagnostic of the inner XPath assertion. You don't get the whole page spewed into your face when you fault! This specification, for example, tests Yury Kotlyarov's user login page, from: http://gith