I have this type of table row generated in a view:
...
<tr class="forex_rate_line"
id="row_1_currency_exchange_rate_729">
<!-- # id:integer:not null:primary key -->
<td class="base_currency">CAD </td>
<td class="quote_currency">USD </td>
<td class="effective_date">2009-04-05 </td>
<td class="forex_type">TEST </td>
<td class="base_rate_is_0.8444">
1.184273
</td>
<td>features test </td>
</tr>
...
There are many instances of dorex_rate_line and I wish to select only
those that also contain a class "base_rate_is_0.8444" and I wish to
valiously test that there are: at least, exactly, or at most, N
occurrences.
For the exact match I have tried this:
count = 1
assert_select( ''.base_rate_is_0.8444'', { :count =>
count.to_i } )
But that gives this error:
Expected at least 1 element matching "base_rate_is_0.8444", found 0.
<false> is not true. (Test::Unit::AssertionFailedError)
On the other hand, using exactly the same data I do this and it works as
I anticipate:
count = 1
code = ''USD''
assert_select( ''.quote_currency'',
{ :maximum => count.to_i,
:text => code })
So, what is it that I am misapprehending with assert_select?
--
Posted via http://www.ruby-forum.com/.