Please sign in to comment.
Don't depend on database ordering for asset tests
test_should_edit_asset and test_should_update_asset were depending on database-specific ordering of the newly added assets. Although these tests worked with MySQL, they failed with PostgreSQL because an unordered find does not necessarily return the first of the three uploaded assets. Instead, Asset.find was changed to Asset.find_by_filename to specifically return the desired asset file. Asset.find_by_filename is used instead of Asset.find(:order => :id) so that there is no dependence on the order in which the three versions of the asset file are added.
- Loading branch information...
Showing with 6 additions and 4 deletions.