Chapter 20 -- Full System Testing -- Customized string template

Skip to first unread message


Sep 28, 2010, 12:28:04 PM9/28/10
to mvc2inaction-discuss
Ch. 20 has been very helpful in helping me to make my web tests less
brittle, but there are a couple of problems with some of the
strategies presented.

Specifically, when you create your own String template for your app
(as in Listing 20.19), you end up with a span that has the id for the
element you're displaying, based on the model metadata. So far so

But if you use this string template in any sort of loop (say, to
populate list items in an unordered list), you now have invalid
markup, as you'll have duplicate ID's for each of the instances of
that string property.

Does anyone have any good ideas on how to avoid this problem?


Sep 28, 2010, 4:04:23 PM9/28/10
to mvc2inaction-discuss
Please disregard the initial post

Sorry guys, I saw that I missed the whole part about using the indexed
property that appends the item index to the element ID.
Reply all
Reply to author
0 new messages