Re: tag in HTML 5 (was Re: [Rails] Re: assert_select for textvalue)

2010-08-30 Thread Colin Law
On 30 August 2010 16:44, Chris Mear wrote: > On 30 August 2010 15:47, Marnen Laibow-Koser wrote: >> Colin Law wrote: >>> I have the following html >>> textvalue >>> I can use >>> assert_select "p>b", "text" >>> to check the text portion, and >>> assert_select "p", "value" >>> to check that the va

Re: tag in HTML 5 (was Re: [Rails] Re: assert_select for textvalue)

2010-08-30 Thread Colin Law
On 30 August 2010 16:44, Chris Mear wrote: > On 30 August 2010 15:47, Marnen Laibow-Koser wrote: >> Colin Law wrote: >>> I have the following html >>> textvalue >>> I can use >>> assert_select "p>b", "text" >>> to check the text portion, and >>> assert_select "p", "value" >>> to check that the va

Re: [Rails] Re: assert_select for textvalue

2010-08-30 Thread Colin Law
On 30 August 2010 15:47, Marnen Laibow-Koser wrote: > Colin Law wrote: >> I have the following html >> textvalue >> I can use >> assert_select "p>b", "text" >> to check the text portion, and >> assert_select "p", "value" >> to check that the value appears in a .  I cannot work out how to >> check

tag in HTML 5 (was Re: [Rails] Re: assert_select for textvalue)

2010-08-30 Thread Chris Mear
On 30 August 2010 15:47, Marnen Laibow-Koser wrote: > Colin Law wrote: >> I have the following html >> textvalue >> I can use >> assert_select "p>b", "text" >> to check the text portion, and >> assert_select "p", "value" >> to check that the value appears in a .  I cannot work out how to >> check

[Rails] Re: assert_select for textvalue

2010-08-30 Thread Marnen Laibow-Koser
Colin Law wrote: > I have the following html > textvalue > I can use > assert_select "p>b", "text" > to check the text portion, and > assert_select "p", "value" > to check that the value appears in a . I cannot work out how to > check that the two are in the same . I have used assert_select for >

[Rails] Re: assert_select for textvalue

2010-08-30 Thread Colin Law
Any thoughts anyone? Colin On 27 August 2010 22:08, Colin Law wrote: > I have the following html > textvalue > I can use > assert_select "p>b", "text" > to check the text portion, and > assert_select "p", "value" > to check that the value appears in a .  I cannot work out how to > check that the

[Rails] Re: assert_select embedded in text

2009-06-15 Thread Colin Law
2009/6/14 Marnen Laibow-Koser : > > Colin Law wrote: > [...]> I found a solution to this by adding span tags round my text >> fragments, so that the html is now >> some textsome more text > [...] >> This works but feel there must be a better solution than adding extra >> tags to the html just so t

[Rails] Re: assert_select embedded in text

2009-06-14 Thread Marnen Laibow-Koser
Colin Law wrote: [...]> I found a solution to this by adding span tags round my text > fragments, so that the html is now > some textsome more text [...] > This works but feel there must be a better solution than adding extra > tags to the html just so that it can be tested. Indeed. Try using th

[Rails] Re: assert_select embedded in text

2009-06-14 Thread Colin Law
2009/6/13 Colin Law : > 2009/6/13 Marnen Laibow-Koser : >> >> Colin Law wrote: >> [...] The right point for the break is after 'some text' and before 'some more text' >> >> How about assert_select "p", /some text.*]*>some more text/m ? >> > > No that doesn't work.  The br tag does not a

[Rails] Re: assert_select embedded in text

2009-06-13 Thread Colin Law
2009/6/13 Marnen Laibow-Koser : > > Colin Law wrote: > [...] >>> The right point for the break is after 'some text' and before 'some more >>> text' > > How about assert_select "p", /some text.*]*>some more text/m ? > No that doesn't work. The br tag does not appear in the text for the p tag. T

[Rails] Re: assert_select embedded in text

2009-06-13 Thread Marnen Laibow-Koser
Colin Law wrote: [...] >> The right point for the break is after 'some text' and before 'some more >> text' How about assert_select "p", /some text.*]*>some more text/m ? BTW, you shouldn't be using in the self-closing form unless you're generating XHTML (it is not actually valid HTML), and y

[Rails] Re: assert_select embedded in text

2009-06-13 Thread Colin Law
2009/6/13 Colin Law : > 2009/6/13 Marnen Laibow-Koser : >> >> Colin Law wrote: >> [...] >> } I cannot see how to check that the break is at the >>> right point in the text. >> >> What does the "right point" consist of?  In other words, how (English, >> not Ruby) would you define the break being at

[Rails] Re: assert_select embedded in text

2009-06-13 Thread Colin Law
2009/6/13 Marnen Laibow-Koser : > > Colin Law wrote: > [...] > } I cannot see how to check that the break is at the >> right point in the text. > > What does the "right point" consist of?  In other words, how (English, > not Ruby) would you define the break being at the right point? > Repeating m

[Rails] Re: assert_select embedded in text

2009-06-13 Thread Marnen Laibow-Koser
Colin Law wrote: [...] } I cannot see how to check that the break is at the > right point in the text. What does the "right point" consist of? In other words, how (English, not Ruby) would you define the break being at the right point? > > Any help will be much appreciated > > Colin Best, -

[Rails] Re: assert_select

2009-05-20 Thread Jim Burgess
> assert_select "form" do > assert_select "span[title=required field]", 13 > end Excellent, that is exactly what I was after thanks very much. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] Re: assert_select

2009-05-20 Thread Colin Law
To do what you want with assert_select you can use assert_select "form>span[title=required field]", 13 That is there should be 13 span elements with given title inside form elements or assert_select "form" do assert_select "span[title=required field]", 13 end if you want to insist that all 13 ar

[Rails] Re: assert_select

2009-05-20 Thread Jim Burgess
Thanks for the answers I just looked again at the html rails is generating and in fact the element I'm looking for looks like this: * not: * Would I test for this like so: assert_select "form" do assert_select("span.title.required field", :count => 13) end When I run it

[Rails] Re: assert_select

2009-05-20 Thread Phlip
Jim Burgess wrote: > Hi, > > Testing the view of an application with functional tests, how would one > go about checking that there are a certain number of elements > present on a page, which all belong to a certain class. > > I tried: > > assert_select "form" do > assert_select

[Rails] Re: assert_select

2009-05-20 Thread Rick DeNatale
On Wed, May 20, 2009 at 11:38 AM, Jim Burgess wrote: > > Hi, > > Testing the view of an application with functional tests, how would one > go about checking that there are a certain number of elements > present on a page, which all belong to a certain class. > > I tried: > >      assert_select "

[Rails] Re: Assert_select with count 0

2009-02-03 Thread Aa Wilson
Hello, again. I just wanted to post this here for the future help of anyone searching the archives. This works: assert_select ["[name=?]", "areas[1]"], {:count => 0} Evidently, the areas[1] is a part of the selector (which can be specified as an array), and not the "text" value of the hash.