[rspec-users] Specifying the contents of a date selector

Ashley Moran work at ashleymoran.me.uk
Tue Jan 16 12:52:04 EST 2007

On 16 Jan 2007, at 17:27, David Chelimsky wrote:

> "form>p>select[name='gap_quick_quote_parameters[purchase_date(3i)]'] 
> >option"

Hi David

Thanks for the pointer - that works fine.  I found this out playing  
around with it:

This fails (this is the original one I posted):
     response.should_have "'orm > p > select 
[name="gap_quick_quote_parameters[purchase_date(3i)]"] > option'

This succeeds (obviously the penultimate ]-character is interpreted  
as closing the *first* [-character):
     response.should_have 'form > p > select 
[name^="gap_quick_quote_parameters[purchase_date(3i)"] > option'

So apparently, using double quotes inside the CSS selector breaks  
bracket matching.  I wouldn't like to guess why it does that.

Anyway it's working now so I'm happy.


PS I edited those code lines by hand in case they contains errors

More information about the rspec-users mailing list