List Info

Thread: Site drop unit test




Site drop unit test
country flaguser name
China
2007-07-20 18:44:24
Hi all, just noticed an ordering problem in the site drop unit test on trunk.

<["&lt;Article:1>", "<;Article:6&gt;", "<Article:7&gt;", "<Article:2>;", "<Article:15>;", "<Article:16>;", "<Article:17>;", "<Article:14>;", "<Article:13>;", "<Article:12>;"]> expected but was
<["<Article:1>", "<Article:6>", "&lt;Article:7>", "&lt;Article:2>", "<;Article:17>", "<;Article:16>", "<;Article:15>", "<;Article:14>", "<;Article:13>", "<;Article:12>"]>.

This test uses the latest_articles method in the site drop, which in turn does a find_by_date, which in turn looks at the published article date. The only problem is that articles 15, 16, and 17 in the fixtures all use the same date, namely Time.now.utc.beginning_of_month.advance(:months => -1). By my reckoning it's implementation dependent as to which order the articles are returned in.

The following patch adjusts the dates for these fixtures by a few seconds to ensure the order specified in the unit test: 


Result is a clean run of the unit tests on my system. (Now for the functionals...)

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )