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
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
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
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
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
>
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
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
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
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
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
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
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
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
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,
-
> 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
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
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
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
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 "
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.
20 matches
Mail list logo